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 trialIdan shami
13,251 PointsI don't understand why 'DONE' is infinite...
I understand that new_itme, for example, is infinite because you can add always more items, and you don't have a limit for how many items you put on the list.
But 'DONE' is not infinite, you can not write DONE many times, only 1 time... maybe this question is kind of stupid but if you have an example it will help a lot...
Thank you, Idan.
2 Answers
Nazim Mohamed
1,014 PointsDONE isn't infinite you can only enter it once and the the code stops using the BREAK
Idan shami
13,251 Pointsso why he is indented to the while loop?
Nazim Mohamed
1,014 PointsIt is indented in the loop so that it is checked for everytime the loop runs, but the moment the DONE is inputted the BREAK stops the code regardless of it being in the loop.
Idan shami
13,251 Pointsok, thank you.
Idan shami
13,251 PointsIdan shami
13,251 Pointswatch the video ^ to know what i am talking about P: Thanks.