如何在python中使用"按Enter键继续"功能?

Pra*_* A. 7 python

我正在python(基于终端)编写一个自己选择冒险的游戏风格游戏,我希望程序暂停打印直到enter按下按钮.这是一个例子.

print("zzzzzzzzz")
Run Code Online (Sandbox Code Playgroud)

进入继续的新闻将来到这里.然后,在他们按下回车后,此块将运行.

print("yyyyyy")
Run Code Online (Sandbox Code Playgroud)

Python 3是首选.

Zdr*_*nev 14

Python 2:

raw_input("Press Enter to continue...")
Run Code Online (Sandbox Code Playgroud)

Python 3:

input("Press Enter to continue...")
Run Code Online (Sandbox Code Playgroud)