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 trialXiaoqian Zhou
6,506 PointsNameError: name '' is not defined
Entered the same code as instructed, able to import character from Character and set player = Character() and is getting asked to input Name:. But then if i enter anything (e.g. Kenneth), it will return this error - "NameError: name 'Kenneth' is not defined". Please help~
Tonye Jack
Full Stack JavaScript Techdegree Student 12,469 PointsUse python 3.5, you'll have use the shell for 3.5 to run the program.
3 Answers
Joseph Holms
5,409 PointsI recommend switching to python 3, as generally most applications now are geared towards 3. I recommend mac ports, it may help with an easy python 3 setup
Xiaoqian Zhou
6,506 PointsHuh guess the new question is how to close a question...
Xiaoqian Zhou
6,506 PointsAlso needed to remove weapon_choice in 'sab' - not sure why but (arent they both strings?) but using if elif elif else works well
Xiaoqian Zhou
6,506 PointsXiaoqian Zhou
6,506 PointsFixed the issue - my mac is on Python 2.7, and input() can only accept existing values defined before. Used raw_input() instead and is able to get around it. :D