In the last lesson you learned how to compare a string to the word "computer." What would happen if the
person typed the word "Computer" or "COMPUTER" or "CoMpUtEr"? Should these compare favorably to "computer" as well? It depends
if you want it to, but indeed "computer" is not equal to "Computer" or "COMPUTER."
You are probably familiar with "case sensitive" passwords online, meaning upper and lower case letters are treated differently;
this is the heart of the issue.
If you want to ignore the case of letters in a comparison, you first have to covert your incoming string to all upper or all lower case first. You can
do this with the string.lower() or string.upper() functions.
Now you try. Run this code and type in the word computer with different cases, like Computer or COMPUTER.
Type your code here:
See your results here:
This code will work. Try typing the word "computer" at the prompt, with different variations of the case of the letters. It'll still work,
since the entire string is converted to lowercase before doing the comparison. CHALLENGE: How would you change the code that would
first convert the string in variable a to upper case?
Share your code
Show a friend, family member, or teacher what you've done!