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

My code won't run

TICKET_PRICE = 10

tickets_remaining = 100

print("there are {} tickets remaining.".format(tickets_remaining )

Name = input("type in your name?")

Number_of_tickets=input( Name "how many tickets would you like to by? ...")

Num_tickets=int(Number_of_tickets)

Amount_due=Num_tickets*TICKET_PRICE

print("The total {0} is...".format( Amount_due))

When I try to run this code I get the following error File "masterticket.py", line 7
Name=input("type in your name?")
^
SyntaxError: invalid syntax

2 Answers

Ben Hedgepeth
seal-mask
.a{fill-rule:evenodd;}techdegree
Ben Hedgepeth
Python Web Development Techdegree Student 10,287 Points

On Line 3, you are missing a paren.

On Line 5, you didn't format your string properly.

On Line 8, I would recommend using a string as placeholder within {}. Then within .format(), type a keyword argument such as .format(amount=amount_due).

It looks like you're missing a ) at the end of

print("there are {} tickets remaining.".format(tickets_remaining )