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 Pointshelp on python
I PUT THIS TICKET_PRICE = 10
tickets_reamining = 100
while tickits_reamining >= 1:
print("there are {} tickets reamining.".format(tickets_reamining))
name = input("whats yourname ? ")
tickits_you_want = input("how many tickits you want {} ".format(name))
try:
tickits_you_want = int(tickits_you_want)
if tickits_you_want > tickits_reamaning:
raise ValueError("there are on an x amount of tickits 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 = tickits_you_want * TICKET_PRICE
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")
tickers_remaining -= num_tickits
else:
print("you suck")
I GET THIS ERR
treehouse:~/workspace$ python masterticket.py
File "masterticket.py", line 5
while tickits_reamining >= 1:
^
IndentationError: unexpected indent
1 Answer
Schaffer Robichaux
21,729 PointsShmuel, There are a couple indention errors towards the bottom of your code. Hopefully this gets you back on track.
if should_prossed.lower() == "y": # <- You need to include the colon
print("sold please come by again dear")
tickers_remaining -= num_tickits
else:
print("you suck") # <- You need to indent
Dave StSomeWhere
19,870 PointsDave StSomeWhere
19,870 PointsTry fixing your spelling errors first - you create a variable called
tickets_reaminingand then trywhile tickits_reamining- you need to be consistent and use either tickets or tickits through out the entire script.