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
5 Answers
+ 3
count =0
for i in range(5):
x=int(input())
if(x>=3):
count=count+100
else:
continue
print (count)
+ 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
+ 4
Rik Wittkopp ok sir i understood ur opinion ..
+ 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.
+ 1
Olawale Odebode try solve it with while loop bro