Python 如何为输入字符串忽略案例

Python 如何为输入字符串忽略案例,python,string,substring,ignore-case,Python,String,Substring,Ignore Case,这是我正在学习的示例代码。我想获取一个字符串(1个或多个字符),并将其与现有字符串进行比较。我想输入蓝色,仍然可以得到答案。如何完全忽略这个案例? 谢谢 对于成功案例: C:\PythonMasterClass>python IfProgramFlow.py Enter a character: Blue The letter Blue is in the Norwegian Blue 对于失败的案例: C:\PythonMasterClass>python IfProgr

这是我正在学习的示例代码。我想获取一个字符串(1个或多个字符),并将其与现有字符串进行比较。我想输入蓝色,仍然可以得到答案。如何完全忽略这个案例? 谢谢

对于成功案例:

C:\PythonMasterClass>python IfProgramFlow.py  
Enter a character: Blue  
The letter Blue is in the Norwegian Blue
对于失败的案例:

C:\PythonMasterClass>python IfProgramFlow.py  
Enter a character: blue  
Sorry the letter is missing
我已经检查了其他线程,以将输入和实际文本转换为小写并与之进行比较,但我想要一种直接的方法。 如果我有多个字符串,我不想为了这个目的将它们全部保存为小写。
谢谢。

尝试:
如果parrot.lower()中的letter.lower()看到了这一点:

今天早上,我只想用Java中的方法来匹配字符串。谢谢。
C:\PythonMasterClass>python IfProgramFlow.py  
Enter a character: blue  
Sorry the letter is missing