0
I don't understand what is the problem with this code
total = 0 i = 0 while i < 5: age = int(input()) i = i + 1 if age < 3: continue total += 100 print('total')
5 Respuestas
+ 6
i am pretty sure that this is an exercice from the old *python for beginners* tutorial.
the task description is:
> 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
> Program needs to take the ages of 5 passengers as input and output the total price for their tickets
following this, we have to fix 3 issues to make the code run properly:
https://code.sololearn.com/cbM63pdkOo6f/?ref=app
+ 5
Did you indent your code properly
+ 5
Пусть Будет Амир What is the code supposed to do?
+ 5
When printing a variable in python you don't need quotation marks that is it was supposed to be print(total) not print ('total')
0
fixed code :) total = 0
i = 0
while i < 5:
age = int(input())
i = i + 1
if age < 3:
continue
total += 100
print(total)