Break/break | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Break/break

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 Jan 2022, 11:11 AM
Mastermind
4 Answers
27th Jan 2022, 11:47 AM
RšŸ’ šŸ‡®šŸ‡³
RšŸ’ šŸ‡®šŸ‡³ - avatar
+ 4
Where is your try Mastermind ?
27th Jan 2022, 11:15 AM
Jayakrishna šŸ‡®šŸ‡³
+ 3
total = 0 i = 0 while i < 5: i = i + 1 age = int(input()) If age > 2: total = total + 100 else: continue print(total) And this seems to be working. ****************************** I don't know how to tag my codes that's why I wrote them straight here.šŸ™ˆ
28th Jan 2022, 11:59 AM
Mastermind
+ 1
Mastermind to put a code into a post/reply/wherever click/tap on the little code button {} and then click/tap the plus button +, choose your language, write away and save. When you are replying/posting etc there is usually another button to add your saved code.
28th Jan 2022, 10:23 PM
Ausgrindtube
Ausgrindtube - avatar