Here is my sample code I'm learning. I want to take a string (1 or more characters) and compare it against the existing string. I want to enter blue and still get the answer. How to ignore the case completely? Thanks.
parrot = "Norwegian Blue"
letter = input("Enter a character: ")
if letter in parrot:
print("The letter {0} is in the Norwegian Blue".format(letter))
else:
print("Sorry the letter is missing ")
for a success case:
C:\PythonMasterClass>python IfProgramFlow.py
Enter a character: Blue
The letter Blue is in the Norwegian Blue
and for the failed case:
C:\PythonMasterClass>python IfProgramFlow.py
Enter a character: blue
Sorry the letter is missing
I've checked other threads to convert my inputs and actual text to lower case and compare against, but I wanted a straight way. What If I have multiple strings, I don't want to save all of them in lower case for this purpose. Thanks.