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 trialSteve Davis
5,332 PointsCreate a loop that goes forever. Capitalization is important.
Stuck here. Any suggestions are welcome. Thanks!
7 Answers
Jason Anello
Courses Plus Student 94,610 PointsHi Steve,
A while loop would go forever if the conditional test on it is always true.
while True
is what the quiz is looking for. The capitalization hint is for the boolean True
value. It's capitalized.
Steve Davis
5,332 Pointstype while in the first line, and True in the second line. I was looking for more too, but that's all that is required.
Gabriel Kabik
790 PointsYup, now I see where I missed it. Thanks!
Steve Davis
5,332 PointsJason, thanks for your response. That's exactly what I did, but for some reason it doesn't work in this quiz. Maybe it's my syntax? or? There are only two short lines to enter code.
Jason Anello
Courses Plus Student 94,610 PointsI had tried it before answering and it passed.
There were two input fields. You'd want to type while
in the first one and True
in the second one and I think the colon :
was already there for you at the end.
Did you by chance type both words into one of the input fields?
Steve Davis
5,332 PointsWow, yes, that's exactly what I did, because I thought the test question demanded the conditional test also. In other words, what is True? Anyway.. Thanks, that worked!
I think what I am realizing about these tests are the fact that the person writing the test can type anything into the answer field, even if it is an incomplete statement, etc. So, it becomes a guessing game as to what they are after for the correct answer. Not that I am criticizing the writer of the test!
Jason Anello
Courses Plus Student 94,610 PointsThe True
part is the conditional test. That's why it loops forever because the test is always True
Steve Davis
5,332 PointsOK, I thought one had to specify more detail than that. All the examples I saw had more conditions.
Thanks for your help!
Gabriel Kabik
790 PointsMaybe I'm just having a bad brain day, but the suggested solution to this question isn't working for me. I've tried entering while True
as the answer and it's telling me I'm wrong. What am I missing?
Jason Anello
Courses Plus Student 94,610 PointsHi Gabriel,
The quiz looks like this:
>>>
__________ ________ :
There are 2 text input boxes there. Are you putting while
in the first one and True
in the second one?
Gabriel Kabik
790 PointsYup! That's exactly the mistake I was making. I was doing it on iOS and the word wrap made it look like the two blank spaces are actually one long blank space broken up on two lines. I knew it was something silly I was missing. Now to go get that badge!
Also I just noticed that my "Shut Up!" extension in Chrome was blocking me from seeing nested comment replies, which explains why I was so confused by the conversation before. Thanks for the help!
MUZ141048 Mugove Mapaike
2,784 PointsWhile True