- 3

Help me please

Please generate this code for me . I m stucked here 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

4th Mar 2022, 2:48 AM
Mary Rian
Mary Rian - avatar
7 Answers
+ 1
G'day Marky Rian Have you found the search bar in SoloLearn Q&A (it is the magnifying glass icon at the top of the discuss screen)? Have you read the FAQ? Do you know you can link "code bits" or other Q&A posts here (use the plus icon). https://www.sololearn.com/discuss/1316935/?ref=app https://www.sololearn.com/discuss/333866/?ref=app
4th Mar 2022, 2:51 AM
HungryTradie
HungryTradie - avatar
+ 1
Hint: 1.Take 5 inputs using range. 2.Keep checking if the input is less than or equal to 3, if it is then do nothing. If it's not, add 100 to a variable which you should give the value 0 at first. 3.Now print the variable.
4th Mar 2022, 3:57 AM
NEZ
NEZ - avatar
+ 1
I got it
4th Mar 2022, 5:45 PM
Mary Rian
Mary Rian - avatar
0
print(sum([100 for i in range(1,6) if int(input(str(i)+':'))>3]))
4th Mar 2022, 7:13 AM
Shadoff
Shadoff - avatar
0
#NEZ still confused.
4th Mar 2022, 3:49 PM
Mary Rian
Mary Rian - avatar