Why are we being asked to learn iteration tables? What is the point?Show Answer
Your ability to create iteration tables or create code that matches an
iteration table demonstrates that you understand not just how to achieve a
specific result, but how to create a specific *process* that achieves that
result. This is important, because in many cases the process is just as
important as the result itself, in part because a well-designed process
will be less error-prone than a poorly-designed process, even if they
achieve the same result in *some* cases.
What is an "infinite loop" and how can you avoid creating one?Show Answer
An "infinite loop" is a loop that never ends, in most cases it is a while
loop where the loop condition never ends up being False. To avoid infinite
loops, makes sure that the code in your loop changes at least one variable
that's used in the loop condition, and that it does so in a way that will
eventually make that condition false. Also, if you know how many times you
want to execute the loop, use a for loop instead of a while loop.