+ 1

what is wrong here

with any program there are many ways to write a solution. I have looked at one from Cory M and it seems to imply that this works. It does not show indents and also there is a capital P in passenger so it will not work. I did a few modifications with indents and it worked. I believe that my solution is also correct. Can anyone tell me if this is the case or where my solution is wrong. Thanks total = 0 passengers=5 while passengers>0: age = input() if int(age)>=3: total=total+100 passengers=passengers-1 print("

quot;+str(total)) Peter Peter

16th Jan 2022, 3:39 AM
Peter Grey
3 Réponses
+ 3
Did you try what I told you before? All you need to remove the ` sign from the final output. https://www.sololearn.com/Discuss/2961799/?ref=app
16th Jan 2022, 4:21 AM
Simba
Simba - avatar
+ 1
total = 0 #to initialize total variable i = 0 # to run the loop #your code goes here while i <5: # to take 5 inputs age = int(input()) if age > 3: total += 100 i += 1 # to increase variable i after each iteration. print(total) //Credit: Simba
16th Jan 2022, 3:43 AM
NEZ
NEZ - avatar
+ 1
Thanks for that. I have been writing commercial assembler programs for a lot of years. Adding a $ sign just makes it more clear, in my opinion. I am still just learning how Sololearn works and it appears you have to be 'exact' not just right. Thanks for the reply and my apologies for not getting back sooner. Peter
18th Jan 2022, 3:35 AM
Peter Grey