For loops, part 2 - Tom Kleen

for i in range(4): print(i) Example to print the numbers 1 through 4 (i ranges from 0 to 3) for i in range(4): print(i+1) Using a for loop with a range, version 2. We can also provide two arguments to the range function. The first argument is the starting point and the second argument is beyond the ending point! for i in range(1,4): #1, 2, 3 ... ................
................