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

Type python.masterticket.py into console, press enter, and it says "command not found?"

This might be a dumb question, but I type this code in, named the file python.masterticket.py just like the video, typed it into the console, and it says command not recognized?

Code -

TICKET_PRICE = 10

tickets_remaining = 100

Output how many tickets are remaining using the tickets_remaining variable

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

Gather the user's name and assign it to new variable

name = input("What is your name? ")

Prompt the 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 of the tickets (Number of tickets x price per ticket) and shown the cost

amount_due = num_tickets * TICKET_PRICE

Output the cost on screen.

print("The total cost is {}".format(amount_due))

Console -

treehouse:~/workspace$ python.masterticket.py

Press "Enter/Return And this returns: **

bash: python.masterticket.py: command not found
treehouse:~/workspace$

2 Answers

Grigorij Schleifer
Grigorij Schleifer
10,365 Points

Hi Avi, you should type

# no dot between python and masterticket
python masterticket.py

instead of

python.masterticket.py
Podrig Leoghain
Podrig Leoghain
5,094 Points

Avi you should really mark an answer as correct. Did Grigorij's answer work? (Spoiler: it should do!)

Oh sorry! How do I do that? I marked his as the best answer, but didn't see an option for correct. (New here)

Podrig Leoghain
Podrig Leoghain
5,094 Points

My mistake, 'best answer' is correct (pun intended).

aditya verma
aditya verma
1,853 Points

i just used the File->Open option; as typing python masterticket.py wasnt doing anything.