Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Mike Buenaventura
422 PointsHello everyone. I tested my: python masterticket.py...
When it says, "How many tickets would you like, Mike?" I typed in 3 and my total due was $13.... Craig's total was $30 for 3 tickets. Please explain how this is possible?
3 Answers
Brian Jensen
Treehouse TeacherAwesome, thanks for sharing your Workspace Mike Buenaventura!
You were ultra close! There is just a tiny issue with what math operator you used on line 20 in your code. Currently, you have this:
amount_due = num_tickets + TICKET_PRICE
So, when that line runs num_tickets which is 3 gets added to TICKET_PRICE, which is 10. You just need to change the math operator there to use multiplication instead of addition, then you will get the same value as Craig.
Mike Buenaventura
422 PointsThanks for the reply Brian. Here is the link: https://w.trhou.se/brv841nhmm
Mike Buenaventura
422 PointsThank you Brian. I went to the console, typed in 98... the total is $980... proceed...y..... sold... then it said, "Sorry the tickets are all sold out!!!".... Any more hints and tips please? There should be 2 tickets remaining.
Brian Jensen
Treehouse TeacherYou're welcome, Mike Buenaventura
You just need to remove the indentation in front of your print("Sorry the tickets are all sold out!!! :(") statement. That way, it won't run that line until after the while loop ends.
Brian Jensen
Treehouse TeacherBrian Jensen
Treehouse TeacherHiya Mike Buenaventura
We'll need to see your code to better assist you. Check out this video about sharing a snapshot of your workspace, then we can take a look.