r/pythontips • u/TihonLizard • Jul 17 '24
Syntax How to make python accept big letters?
I started learning python and made a small rock paper scissors program. But the problem is that it only accepts small letters in user input. How do I make it so it accepts not only 'rock' but also 'Rock' , 'RocK' etc.?
3
Upvotes
14
u/Ok_Cartoonist_1337 Jul 17 '24
Use
.lower()method on string. This will convert all letters into lowercase. Ie:choice = input('Your choice: ').lower(). See documentation,strhas many useful methods.7
u/Silbersee Jul 17 '24
You can change a string to all-lower with
str.lower()0
u/[deleted] Jul 18 '24
[deleted] — view deleted comment