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 Python Basics All Together Now Gather Information

Dantee Fluellen
Dantee Fluellen
1,499 Points

Wrong answer

I have everything right just my answer for one ticket is not coming out right instead of 10 for the price i keep getting 111111. i dont know why

this is my code

TICKET_PRICE = 10

tickets_remaining = 100

output how many tickets are remain using the remaining_tickets variabl

print("There are {} tickets left.".format(tickets_remaining))

gather the users name and assign it to a new variable

full_name = input("What is you full name? ")

promte the user by name and ask them how many tickets you would like

number_of_tickets = input("{}, How many tickets would you like? ".format(full_name)) number_of_tickers = int(number_of_tickets)

cal the price of ticket (number of tickets by the number of tickets) and assign it a new variable

ticket_total = number_of_tickets * TICKET_PRICE

output the price to the screen

print("Amount due is, {}".format(ticket_total))

Steven Parker
Steven Parker
231,268 Points

When posting code, use Markdown formatting to preserve the code's appearance and prevent certain characters from being consumed. An even better way to share code and make your issue easy to replicate is to make a snapshot of your workspace and post the link to it here.

Jonathan Davidson
Jonathan Davidson
1,641 Points

you have a spelling error. You put number_of_tickers when converting to an integer instead of number_of_tickets

2 Answers

Dantee Fluellen
Dantee Fluellen
1,499 Points

thanks a lot. can you help me i fix someone else problem with this same issues but not i can seem to fix my owns. https://w.trhou.se/oyka72xeit As you can see in my workspace under pass.py everything works fine. But then when you go to masterticket.py it stay at 100 tickets. All i did was take out the comments so i dont understand what is wrong.

Steven Parker
Steven Parker
231,268 Points

The "if" statement, and the lines it controls, all need to be indented more to place them inside the "while".
Otherwise, the question is being asked but answer is never acted on.

Steven Parker
Steven Parker
231,268 Points

Dantee Fluellen — Glad to help. You can mark the question solved by choosing a "best answer".
And happy coding!