+ 6
while True:
rate(100)
#what does this rate(100) do?
try:
'something'
except:
'something else'
In Python many expressions can be tested for truth (that is evaluate to True or False when used in conditions and logical operations). For example non-empty sequences or non-zero numbers as you have evaluate to True. So this loop will run forever or until some code explicitly breaks out of it. This is because the loop condition is hard-coded to Trueso will never evaluate to False to exit the loop.
while 1 is a special case of while loop: It's a so-called "infinite loop".
Of course nothing is infinite. What the code is saying is: Run the contents of this loop until something inside causes it to exit. There's no explicit test in the loop, so the exit condition must be inside.
when condition in while loop is false then it stop it's execution and exit the loop