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 trial2 Answers
Tyler Herbst
11,763 PointsHi John,
The reason is you need define the variable "answer" as an empty string. If you don't, you'll get an error saying "undefined local variable or method 'answer' ".
Hope that helps!
Tyler
rowend rowend
2,926 PointsHi, you need this variable before the loop to solve scope variable problems. If you define the variable answer inside the loop you could use the variable inside of code of block of while loop but you could not use it as part of the condition of the loop.
Maciej Czuchnowski
36,441 PointsMaciej Czuchnowski
36,441 PointsPlease explain your problem and link the proper challenge.