While You’re Here: link to exercise


#1

Question

While You’re Here: link to exercise

Answer

We include count += 1 inside the while loop so that eventually count becomes 10 and our loop condition becomes False. Otherwise, count will never be 10 or greater and our loop will continue on forever!
Take care when writing while loops in the future and make sure you indent within the loop some change to your condition to avoid infinite loops!


FAQ: Learn Python- Loops - While you're here