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

Hi guys help me, am running the following code but its giving an error syntax message!

TICKET_PRICE = 10 tickets_remaining = 100
TICKET_PRICE = 10 ticket_remaining = 100

Out put how many tickets remaining using the tickecket remaining

print("There are {} tickets remaining".format (ticket_remaining)

Gather the user”s name and assign to it to a new varaiable

name = input("What is your name? "

prompt user by name and ask how many tickets they would like?

num_tickets = input("How many tickets would you like {}?".format(name)) num_tickets = int(num_tickets)

Calculate the price (number of tickets multiplied by the price)

amount_due = num_tickets * TICKET_PRICE

Out put the price to the screen

print ("The total_due is ${}".format(amount_due)

2 Answers

Steven Parker
Steven Parker
231,236 Points

It looks like most of the function calls are missing the final closing parenthesis at the end of the line.

For example:

name = input("What is your name? "    # original code
name = input("What is your name? ")   # fixed

For future questions, please use Markdown formatting for the code. Instructions can be found in the Markdown Cheatsheet pop-up below the "Add an Answer" area. :arrow_heading_down:   Or for more detailed instructions, you can watch this video on code formatting.

Thanks Steve, I wonder why I couldn't pick this!