Ticket Price | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Ticket Price

Hi there… somebody who can help me with the practice 26.3 (Ticket Price) I have some days trying to solve it and I can’t move on… I typed a code that works in my computer but doesn’t work in that number of practice. If someone can send me the code for that practice I will appreciate it.

30th Jan 2022, 7:53 PM
Jonathan Payan Rodriguez
Jonathan Payan Rodriguez - avatar
5 Answers
+ 9
Jonathan Payan Rodriguez , here is your code with comments, already corrected in this case. please compare it against your original code: i=0 price=0 while True: # while has to be lower case personas= int(input()) # wrong quotes // do not output any prompt!! if personas >= 3: price+= 100 i+=1 # wrong indentation if i>=5: # wrong indentation print(price) break # break has to be in lower case happy coding!
30th Jan 2022, 9:43 PM
Lothar
Lothar - avatar
+ 4
Jonathan Payan Rodriguez , please do not ask the community to give you a ready made code. this does not really help you. please post your code here, so that we can see where the issue is. it does not matter if it works not or not. thanks!
30th Jan 2022, 8:24 PM
Lothar
Lothar - avatar
+ 1
Ok let me post my code (python) and it is wird becase in spyder IDLE work very good according to the expectations or requirements ….
30th Jan 2022, 8:59 PM
Jonathan Payan Rodriguez
Jonathan Payan Rodriguez - avatar
+ 1
i=0 price=0 While True: personas= int(input(“Age: “)) if personas >= 3: price+= 100 i+=1 if i>=5: print(price) Break
30th Jan 2022, 9:03 PM
Jonathan Payan Rodriguez
Jonathan Payan Rodriguez - avatar
0
Post your code and we will find issue so you can learn from your mistakes. If we send you code you wont learn. If test is not passed than you didnt write code for every case thay asked. Read again what thay ask you to do, maybe you forgot to add something. Also what language is this, please tag language, code is not same for every language.
30th Jan 2022, 8:57 PM
PanicS
PanicS - avatar