Why input() gives an error when I just press enter?

后端 未结 4 1899
囚心锁ツ
囚心锁ツ 2020-11-29 12:31

I have the following python code:

print \'This is a simple game.\'
input(\'Press enter to continue . . .\')
print \'Choose an option:\'

...
<
4条回答
  •  天涯浪人
    2020-11-29 13:07

    In Python 2, input() strings are evaluated, and if they are empty, an exception is raised. You probably want raw_input() (or move on to Python 3).

提交回复
热议问题