0
issue with ticketing system
You are making a ticketing system. The price of a single ticket is $100. For children under 3 years of age, the ticket is free. Your program needs to take the ages of 5 passengers as input and output the total price for their tickets. total = 0 a = 1 while a > 0: a += 1 b = int(input()) if b <= 3: continue elif b > 3: total += 100 print(total)
5 Respuestas
+ 1
Because you have an infinite loop!
So when you try to read more inputs than there actually are, you get that EOF error
0
hi, my code works on python 3.0 but it does not on sololearn website, i keep getting error messages on input line
0
Infinite loop?
0
Traceback (most recent call last):
File "/usercode/file0.py", line 5, in <module>
b = int(input())
EOFError: EOF when reading a line
0
total = 0
a = 1
while a <=5:
a += 1
b = int(input())
if b <= 3:
continue
elif b > 3:
total += 100
print(total)
this one worked well ;)))