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 trialVaibhav Kalra
560 PointsInvalid Literal error
TICKET_PRICE = 10
tickets_remaining = 100
while tickets_remaining >0:
print("tickets remaining are {}".format(tickets_remaining))
name = input("Please, enter your name ")
Number = (input("{}, how many tickets would you like to buy ".format(name)))
try:
number = int(number)
except ValueError:
print ("Try again")
else:
Price = TICKET_PRICE * Number
print("Total price is {}".format(Price))
option = input("Do you want to proceed (Y/N)? ")
if option.upper() != "N":
print ("SOLD!")
tickets_remaining -= Number
else:
print("Thanks {}".format(name))
print("Sold Out")
2 Answers
Dan B
6,155 PointsWell why didn't you share the solution because many other people are having the problem Vaibhav Kalra...
<noob />
17,062 Pointsformat ur code itβs very difficult to track the problem
Vaibhav Kalra
560 Pointsgot the solution.
Vaibhav Kalra
560 PointsVaibhav Kalra
560 Pointserror showing up when a word is entered for the number tickets requested.