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 trial

Python Python Basics (Retired) Shopping List Shopping List

Create a loop that goes forever. Capitalization is important.

Stuck here. Any suggestions are welcome. Thanks!

7 Answers

Hi 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.

type 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
Gabriel Kabik
790 Points

Yup, now I see where I missed it. Thanks!

Jason, 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.

I 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?

Wow, 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!

The True part is the conditional test. That's why it loops forever because the test is always True

OK, I thought one had to specify more detail than that. All the examples I saw had more conditions.

Thanks for your help!

Gabriel Kabik
Gabriel Kabik
790 Points

Maybe 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?

Hi 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
Gabriel Kabik
790 Points

Yup! 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!

While True