python ticketing system eof | Sololearn: Learn to code for FREE!


python ticketing system eof

Can someone tell me why I’m getting EoF error? This should work: total = 0 itr = 0 while itr < 5: x = input() print(x) if int(x) < 3: continue else: total += 100 itr += 1 print(total)

3/10/2021 4:15:59 AM

Diego Santamaria

6 Answers

New Answer


when input is lower than 3, itr variable is not incremented, so your loop will run more than expected ^^ you could fix it by moving the incrementation of itr at start of ypur loop ;)


Frogged even if it was user input, if user think there's only 5 values to give as input, if there's more input than expected (and user filled all at once), there will be an eof error... on end of moule project, inputs are provided programatically, not by user ;)


oh woops! what a simple over sight! tha ks!


Frogged this is an end of module project: there's no user input, but a ready to use input...


visph please explain...didn't get u


But that's not the point for eof... It is the input() in the while loop. SL gets input only once for all inputs in prog.