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)

9th Jan 2022, 6:25 PM
Abror Beck
5 ответов
+ 1
Because you have an infinite loop! So when you try to read more inputs than there actually are, you get that EOF error
9th Jan 2022, 6:32 PM
CGM
CGM - avatar
0
hi, my code works on python 3.0 but it does not on sololearn website, i keep getting error messages on input line
9th Jan 2022, 6:26 PM
Abror Beck
0
Infinite loop?
9th Jan 2022, 6:28 PM
CGM
CGM - avatar
0
Traceback (most recent call last): File "/usercode/file0.py", line 5, in <module> b = int(input()) EOFError: EOF when reading a line
9th Jan 2022, 6:28 PM
Abror Beck
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 ;)))
9th Jan 2022, 7:19 PM
Abror Beck