+ 1

Python Input EOF Error

a = input() If a != "": ... b = input() >>>EOF Error ឵When I want to work with an input, I can usually tell if it's empty or not. But when I add a second input, I get the EOF Error. This when I do not enter anything in that window. I'm making the code respond to each possible input, but I can't even know if the second input has empty or not because it's already failing.

27th Jan 2022, 2:25 AM
Enzo Sapienza
Enzo Sapienza - avatar
2 Respuestas
+ 7
Eof error occurs when we have asked the user for input but have not provided any input in the input box. You can overcome this issue by using try-except statement in Python. https://www.sololearn.com/learn/Python/2441/?ref=app
27th Jan 2022, 2:50 AM
Simba
Simba - avatar
+ 3
Simba oh, thanks!
27th Jan 2022, 2:52 AM
Enzo Sapienza
Enzo Sapienza - avatar