Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
210,425 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!