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!
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
Soumik Rakshit2,745 Points
Shouldn't the exception should be NameError instead of ValueError?
I passed the exception ValueError, but i got the error on my Linux terminal called NameError. So I passed the exception NameError and now the program is working smoothly.
Treehouse uses and teaches Python 3. In that version of Python the code demonstrated results in a
ValueError. When ran on Python 2 on the other hand it does indeed result in a
Python 3 and Python 2 have some fundamental changes between them so code designed for Python 3 is not guaranteed to perform correctly in Python 2 and vice versa. I assume you have Python 2 installed on your Linux machine. If you installed Python 3 and ran the code there, you should get the same behavior as demonstrated in the video.