0

Help!

I'm trying to make a code that has several string elements in a list, that when a person inputs in all caps, it asks them to not do that. Why is this code not working? It says my list has too many arguments? But I only have one list in the parenthesis. answers = list('Yes', 'No', 'Maybe') user = input(str('YES')) if str('ES', 'O', 'AYBE') in user: print('PLEASE DONT YELL AT ME')

31st Aug 2020, 2:00 AM
Parallel Visions
Parallel Visions - avatar
2 Réponses
+ 1
Assingn a singal argument inside ( ). Define a var (let's say demand) and get it value = value input by user.
31st Aug 2020, 2:08 AM
Divya Mohan
Divya Mohan - avatar
0
Why don't you use isupper to check if a word is All caps like this str = input() if str.isupper(): print('do not yell at me')
31st Aug 2020, 2:30 AM
Ruba Kh
Ruba Kh - avatar