Python Python Basics (2015) Shopping List App Shopping List Introduction

Idan shami
Idan shami
13,251 Points

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

Idan shami
Idan shami
13,251 Points

watch the video ^ to know what i am talking about P: Thanks.

2 Answers

Nazim Mohamed
Nazim Mohamed
1,014 Points

DONE isn't infinite you can only enter it once and the the code stops using the BREAK

Idan shami
Idan shami
13,251 Points

so why he is indented to the while loop?

Nazim Mohamed
Nazim Mohamed
1,014 Points

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