0

python code problem

can someone possibly help with this please... 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. Sample Input 18 24 2 5 42 Sample Output 400

27th Jun 2022, 12:42 AM
Olawale Odebode
Olawale Odebode - avatar
5 Answers
+ 3
count =0 for i in range(5): x=int(input()) if(x>=3): count=count+100 else: continue print (count)
27th Jun 2022, 1:13 AM
Aly Alsayed
Aly Alsayed - avatar
+ 7
Olawale Odebode please show us what you have done. how many passengers ( 5 ) cost per ticket ( 100 ) limitation age children under 3 is free cost = 0 so using a for loop or a while loop what we need to do is input 5 ages what's the first and only condition is if a child is ... else
27th Jun 2022, 1:10 AM
BroFar
BroFar - avatar
+ 4
Rik Wittkopp ok sir i understood ur opinion ..
27th Jun 2022, 2:17 AM
Aly Alsayed
Aly Alsayed - avatar
+ 3
Aly Alsayed I am sure the OP appreciates you giving him a completed answer, now he doesn't need to try and learn anything. Please try and guide people to a solution, which is the reason we ask them for their attempt. If you do post a solution then attach an explanation with the code so they may understand the underlying principles.
27th Jun 2022, 1:51 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 1
Olawale Odebode try solve it with while loop bro
27th Jun 2022, 2:16 AM
Aly Alsayed
Aly Alsayed - avatar