loops
Did you know that 80% of a computers time is spent in only 20% of the code? The reason for this is most things that a computer does it will repeat over and over again with only small changes. Think about a computer game. It will draw the screen many times every second, normally only showing small changes in the graphics. Each time it does this it will run the same section of code. We call this iteration.
Python’s main way of doing a loop (or iterate) is using a while loop.
a = 1
while a<10:
print a,"times 9 is", a * 9
a = a + 1
Try the above code.
Output: (clear)











