I get an error when I want to play again
I'm using the same code as the one in the video and the download file. When I guess the number and I'm asked if I want to play again, I get this error, both entering y or n:
Traceback (most recent call last): File "number_game.py", line 34, in <module> game() File "number_game.py", line 28, in game play_again = input("Do you want to play again? Y/n") File "<string>", line 1, in <module> NameError: name 'n' is not defined
Can anybody help me solve this issue, please?
Jeff Wilton16,630 Points
Did you forget quotes around the 'n' on this line?
if play_again.lower() != 'n'
No I did not forgot any quote. I also tried with "n" but I get the same error. As I said, it's the exact same code as the one given by Kenneth Love.