+ 1

Python error

Why I'm receiving this error: ================================= Traceback (most recent call last): File "..\Playground\", line 8, in <module> b = input () EOFError: EOF when reading a line ================================= for this code: ================================= a = input() if a == 0: print (a) else: b = input () print (b) =================================

5th Feb 2018, 3:40 PM
Doru Stancioiu
Doru Stancioiu - avatar
5 Answers
+ 2
Doru, when you run it on SoloLearn, don't forget to put in both of your inputs and not just one. ;) Separate the inputs with a new line.
5th Feb 2018, 4:34 PM
Fata1 Err0r
Fata1 Err0r - avatar
+ 2
a = input("") if a == 0: print (a) else: b = input ("") print (b)
5th Feb 2018, 3:53 PM
Fata1 Err0r
Fata1 Err0r - avatar
+ 1
correct synatax input("")
5th Feb 2018, 3:41 PM
Jendlas (Russian)
Jendlas (Russian) - avatar
+ 1
I have the same error with input() or input("") a = input("") if a == 0: print (a) else: b = input("") print (b) ========================================= Traceback (most recent call last): File "..\Playground\", line 6, in <module> b = input("") EOFError: EOF when reading a line ========================================= a = input() if a == 0: print (a) else: b = input() print (b) ============================= Traceback (most recent call last): File "..\Playground\", line 6, in <module> b = input() EOFError: EOF when reading a line
5th Feb 2018, 4:09 PM
Doru Stancioiu
Doru Stancioiu - avatar
0
fix the both inputs to input() and prints to print(a) and print(b)
5th Feb 2018, 4:04 PM
Kuba H
Kuba H - avatar