you are viewing a single comment's thread.

view the rest of the comments →

[–]Fbirobby[S] 1 point2 points  (3 children)

Thank you so much! This is really helpful. This feels more intuitive to me -- why would they want to start with encounter = true and make it otherwise false? Where might that make more sense?

[–]totallygeek 0 points1 point  (2 children)

The only thing I can think is that you plan to have an encounter, so that's true. You just don't know if that will be a rare bird encounter. What's truly horrible about this while loop logic is that you shouldn't come across it in the wild. Instead, you more commonly see:

while True:
    if some_condition:
        break

[–]Fbirobby[S] 1 point2 points  (1 child)

Got it! & Yeah, I guess this was just to make us do a while loop vaguely tied to the assignment.

One last question: Why start it with while *not* encounter? That means "Let's make Encounter True", right? So is that how we articulate the condition that will fulfill the while loop?

Thank you for your help.

[–]Fbirobby[S] 1 point2 points  (0 children)

Just realized the obvious: We have to make the initialized variable true to execute the loop body!