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
William Wright
3,435 PointsI'm getting a syntax error for my ticket proceed question
When I run this below I get a SyntaxError: but its exactly the same code as the teachers (to me anyway); could you give me some help please - the error is specifically on, if shouldProceed.lower() == "y":, citing the colon as the issue.
print ("the total due is £{}".format(totalCost)) shouldProceed = input("Do you want to proceed? Y/N " if shouldProceed.lower() == "y": print ("SOLD!") tickets_remaining -= ticketsRequired else: print ("Thank you anyway {}".format(firstName)) print ("sorry the tickets are all sold out :(")
1 Answer
Zimri Leijen
11,835 PointsYou somehow got a £ that doesn't belong
by the way, please post the code as a code block.
you can do it like this:
```py
past your code here
```
that will look something like this:
print ("the total due is £{}".format(totalCost))
shouldProceed = input("Do you want to proceed? Y/N "
if shouldProceed.lower() == "y":
print ("SOLD!")
tickets_remaining -= ticketsRequired
else:
print ("Thank you anyway {}".format(firstName)) print ("sorry the tickets are all sold out :(")