Skip to content Skip to sidebar Skip to footer

Need Python To Accept Upper And Lower Case Input

I want my Python code to accept both uppercase and lowercase input. I've tried casefold, but with no luck. Any help? advice ='' while advice !=('Yes'): print('Would you like

Solution 1:

You could just make advice uppercase eg.:

while advice.upper() != "YES"

This way it doesn't matter if the user inputs lower or upper case (or a mix).

Post a Comment for "Need Python To Accept Upper And Lower Case Input"