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
Dean Vollebregt
24,583 PointsCompiling Python on a Mac
Hello,
I'm trying to compile Python on a mac using sublime 2 and the terminal. When running the following code from the teachers note's:
try: speed = int(input("What is the airspeed velocity of an unladen swallow? ")) except ValueError: print("What? I don't kno-oooooooooooooooo!") else: print("I think a swallow could go faster than {}.".format(speed))
Then entering "five" to the command line when prompted
Instead of:
What? I dont kno-oooooooooooooo!
I get an error message:
Deans-MBP:treehouse deanvollebregt$ python exceptions.py What is the airspeed velocity of an unladen swallow? five Traceback (most recent call last): File "exceptions.py", line 9, in <module> speed = int(input("What is the airspeed velocity of an unladen swallow? ")) File "<string>", line 1, in <module> NameError: name 'five' is not defined
Do I need to install something on my computer?
Thank you,
Dean