+ 1

Guys is this code faulty coz i am confused if i try it out on ma pc it works but for solo learn project it has refused.

total = 0 passenger = 1 while passenger <= 5: age = int(input("Age: ")) if passenger == 5: if age > 2: total += 100 print(total) break elif age <= 2: print(total) break if age > 2: passenger += 1 total += 100 elif age <= 2: passenger += 1 continue

8th Apr 2022, 11:13 AM
Nsimire Jethro Kakson
Nsimire Jethro Kakson - avatar
2 Respostas
+ 4
Also, you don't need to add prompt messages in your solution. age = int(input())
8th Apr 2022, 11:41 AM
Simba
Simba - avatar
+ 1
in sololearn all input needs to be given at the start of the program. each input must be seperated by a new line when it asks you for input. sololearn is not the best place for interactive programs
8th Apr 2022, 11:30 AM
Slick
Slick - avatar