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

Python

Mike Buenaventura
Mike Buenaventura
422 Points

Hello 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?

Brian Jensen
seal-mask
.a{fill-rule:evenodd;}techdegree
Brian Jensen
Treehouse Teacher

Hiya Mike Buenaventura :wave:

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. :thumbsup:

3 Answers

Brian Jensen
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Brian Jensen
Treehouse Teacher

Awesome, 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. :thumbsup:

Mike Buenaventura
Mike Buenaventura
422 Points

Thank 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
seal-mask
.a{fill-rule:evenodd;}techdegree
Brian Jensen
Treehouse Teacher

You're welcome, Mike Buenaventura :raised_hands:

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.