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 trialDan B
6,155 PointsNameError: name 'if_buzz' is not defined
When running the same code as the teacher's solution.
Inputting the number: 234
Results in this error:
treehouse:~/workspace$ python challenge.py
Please enter your name: Name
Please enter a number: 234
Hello Name!
The number 234...
Traceback (most recent call last):
File "challenge.py", line 30, in <module>
if is_fizz and if_buzz:
NameError: name 'if_buzz' is not defined
The code is exactly the same as the teacher's solution. What causes this error?
It works fine with pretty much every other number.
Steven Parker
231,271 PointsWhat you posted is a temporary workspace link. To get a permanent link you need to use the snapshot function (button with camera icon).
2 Answers
Chris Freeman
Treehouse Moderator 68,454 PointsShould it be is_buzz
instead of iF_buzz
?
Chris Freeman
Treehouse Moderator 68,454 PointsChanged comment to answer.
Dan B
6,155 PointsThanks Chris, you found it! It was that typo.
Dan B
6,155 PointsDan B
6,155 PointsHere you go!
https://teamtreehouse.com/workspaces/41179936