What does .upper() and .lower() do?

Asked by stem_mind · 6 months ago

1 Answer

28
amorebise · 6 months ago Top Answer

These are 'methods' that change the case of your text. .upper() makes everything SHOUTING (capital letters), and .lower() makes everything small letters.

This is very useful for comparing text. If you want to check if a user typed "Yes", you can convert their input to lower case first so it doesn't matter if they typed "YES" or "yes".

Log in to add a comment.