If you’ve incremented numoutside of the while loop, then it will never be reached. When a while loop is entered, it only runs the code indented to be inside of it each time it loops. This means that if you incremented num but didn’t indent it to be in the loop, it never gets executed when the loop runs, and our while condition never becomes false!
I could use some help (I don’t want the answer. I want to figure it out), but every time I run my code I get an infinite loop. I read the comment at the top but I guess I’m still not getting it.
Here is what I have:
num = 1
while num <= 10:
print num ** 2
num = False
There are several problems, for starters, the exponent of 1 is 1. You can see this from your print statement. So you would need to do different math, otherwise num is never going to get 10
also, what do you do with the result of your math operation? You only print it, the num variable never gets updated