I’m currently working on the roulette section of Games of Chance, found here: https://www.codecademy.com/practice/projects/games-of-chance
I want the program to interpret “odd” and “Odd” and “ODD” all as the same answer, so whenever I compare the user’s guess to the number that came up, I set it as guess.lower(). Ok.
But when the user guesses an INT instead of a STRING, the program is giving me this error:
- File “script.py”, line 115, in roulette
elif(guess.lower()==“high” and ball >=19 and ball != 37):
AttributeError: ‘int’ object has no attribute ‘lower’
I can fix it by adding in “type(guess) == str and guess.lower() == etc” to the elif statement but that seems kind of excessive? Is there a more elegant way to do it?