+ 1

I'm stuck on a Loops practice question.

You are making a ticketing system. The price of a single ticket is $100. For children under 3 yea total = 0 passenger_agelist = [18,24,2,5,42] for age in passenger_agelist: if age < 3: continue total += 100 print(total) This is the code I wrote and it fails the other tests. I don't know what's wrong with it.

26th Dec 2024, 3:42 AM
Atem-Ebai Fritzjarvis
Atem-Ebai Fritzjarvis - avatar
1 Answer
+ 6
Atem-Ebai Fritzjarvis you have hard-coded the list of sample test values. Instead the program needs to get the values from the console by using the input() function. Code Coach runs several tests and provides different inputs for each test through console input.
26th Dec 2024, 6:31 AM
Brian
Brian - avatar