0

Some of simple codes run without problem. But I tried to run this simple code on sublime but I got this error. I run same code from command line without a problem. I also install 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')

Error message on 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]
Mobile Gamer
  • 23
  • 1
  • 3
  • Even though the duplicate says Sublime Text 2, the explanation and solution should still apply. – idjaw Oct 13 '16 at 13:18

1 Answers1

0

You need to add a line below, the interpreter is seeing that last line as incomplete without the newline.

mcchucklezz
  • 376
  • 1
  • 16