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

Sonam Shaikh
Sonam Shaikh
3,529 Points

my code is not running

TICKET_PRICE = 10

tickets_remaining = 100

output for how many tickets are remaining using ticket_remaining variable

print(" tickets remaining= ",format(tickets_remaining))

feel welcomed and have a personalised experience

name= input("what is your name? ") print("hey there..", name,"give me a minute please.")

be able to request tickets and see the total amount

tickets_needed = input("how many tickets do you need, {}? ",format(name))

tickets_needed = int(tickets_needed)

amount_due= tickets_needed * TICKET_PRICE

print("the total amount is: ",format(amount_due))

2 Answers

Philip Schultz
Philip Schultz
11,437 Points

Hey it's kind of hard to see, but I think you are putting a comma before the format function instead of a period. I'll keep looking if there is something else, but try to post your code correctly. See the markdown cheatsheet link to see how (See the link below where you are typing in answers and comments)

Hi, Philip is right, it looks like you have commas as opposed to a period in front of the format section.

For example, you have:

print("the total amount is: ",format(amount_due))

While in reality it should look like:

print("the total amount is: ".format(amount_due))