我有一个简单的代码:
#!/usr/bin/env python
import sys
print (sys.version)
list = ["cat", "dog", "horse", "duck"]
for animal in list:
if animal == "cat" or animal == "duck":
print animal
input("Press Enter to continue ...")
print (sys.version)
的输出是
2.7.11 (default, Dec 19 2016, 17:44:19)
[GCC 5.3.0]
但是,按 Enter 后,程序在input("Press Enter to continue ...")
行崩溃,表示错误
SyntaxError: unexpected EOF while parsing
为什么会发生这种情况?
有关