一些简单的代码运行没有问题。 但是我尝试在sublime上运行这个简单的代码,但是我遇到了这个错误。 我从命令行运行相同的代码没有问题。我也安装了anaconda。
number1 = 23
running = True
while running:
guess = int(input('Enter an integer :'))
if guess == number1:
print ('Congrats')
running=False
elif guess<number1:
print('no it is a little higher then that')
else:
print('no it is a little lower than that')
else:
print('the while loop is over')
print('done')
sublime上的错误消息:
Enter an integer :Traceback (most recent call last):
File "\while.py", line 4, in <module>
guess = int(input('Enter an integer :'))
EOFError: EOF when reading a line
[Finished in 0.1s]
答案 0 :(得分:0)
你需要在下面添加一行,解释器在没有换行符的情况下看到最后一行是不完整的。