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
Shmuel Zilberman
1,409 Pointspython help
NOTHING COMES UP WHEN I PUT THIS
SERVICE_CHARGE = 2 TICKET_PRICE = 10
tickets_reamining = 100
def calculate_price(number_of_tickits): return number_of_tickets * TICKET_PRICE * SERVICE_CHARGE
while tickets_reamining >= 1:
print("there are {} tickets reamining.".format(tickets_reamining))
name = input("whats your name ? ")
tickits_you_want = input("how many tickets you want {} ".format(name))
try:
tickets_you_want = int(tickets_you_want)
if tickets_you_want > tickets_reamaning:
raise ValueError("there are on an x amount of tickets left try again man")
except ValueError as err:
print("oh no that doesnt make that much sence type something that makes sence..")
else:
ammount_due = calculate_price(num_tickets)
print("the total is {}".format(ammount_due))
keep_going_man = input("do you wanna continue ? y/n ")
if should_prossed.lower() == "y":
print("sold please come by again dear")
tickets_remaining -= num_tickets
else:
print("try again")
1 Answer
Anthony Crespo
Python Web Development Techdegree Student 12,973 PointsI don't know what is your complete code but I can see some typo on variable name.
- on line 02: tickets_reamining
- on line 07: tickets_reamaning
- on line 18: tickets_remaining