For Loops

 The for Control Structure: 
 * The for loop is used when you want to execute some code a certain number of times. Each for loop has a range which indicates the number of times the code within the loop will be executed.
 * Example: for i in range(0,11) :
 * This loop says start at 0 and iterate 10 times. In this example i is the counter which keeps track of the iteration the loop is on and takes the value of the of the first parameter in range which is 0. The second part of the range is exclusive, meaning that it will exclude 11 and run once for every number in the range 0-10.
 * Summation Example

#Sum numbers from 1 to 10 sum = 0 for i in range(1,11): sum = sum + i   print sum    #The result is 55 # This prints out the first 11 fibonnaci numbers a = 0 b = 1 for i in range(0,11):   #Do upto the 11th fibonacci number print a       a,b = b,a+b #assigns a to b, and b to a+b print "End of Processing" # The first loop will iterate 10 times. For each of these # iterations the second loop will iterate 10 times and each # time a is incremented by 1. Therefore a gets incremented # 100 times and will equal 100 at the end. a = 0 for x in range(0,10): for x in range(0,10): a += 1 print a  #prints 100
 * Fibonnaci Numbers Using For Loops:
 * Nested For Loops