+ 2

EofError in my Python Loop.. What am I doing wrong? Still new to python..

An Error occured in my "Who_You_Gonna_Call?"-Code, but I am to tired to solve it..

26th Nov 2016, 12:14 AM
smallybells
smallybells - avatar
5 Respostas
+ 1
Of course its under my Codes, thanks already for you answer:)
26th Nov 2016, 9:11 AM
smallybells
smallybells - avatar
+ 1
I'm not too sure about the EOF Error in your code; I'll get to that later. There are a few "or"s in your code. You can use the string.lower() method: g_busters = g_busters.lower() to change all characters to lowercase. Also, you don't need the i += 1 . range() will increment it for you. You don't have to print("\n" + "text") ; you can just print("\ntext")
26th Nov 2016, 10:07 AM
Samuel Neo
Samuel Neo - avatar
+ 1
thanks for your help!
26th Nov 2016, 10:08 AM
smallybells
smallybells - avatar
+ 1
I'm guessing that it's because of the way the SoloLearn code playground works. It only asks for input once, and in your code, you need more input based on a condition. This way, no input is given to the second input(), which raises an EOF Error. If you try it out on Python IDLE, I won't be surprised if it works without raising an EOF Error.
26th Nov 2016, 10:27 AM
Samuel Neo
Samuel Neo - avatar
0
It's probably due to parsing / dealing with data types / end of file or input. May I see the source code?
26th Nov 2016, 3:57 AM
Samuel Neo
Samuel Neo - avatar