For loops loop in a specified range.
Syntax-
for var_name in range (start_num, end_num):
Example-
def sun():
image = SimpleImage(’apple_tree.jpg’)
width = image.width
height = image.height
for y in range (0, height):
for x in range (0, width):
pixel = image.get_pixel (x, 0)
pixel.red = 255
pixel.green = 165
pixel.blue = 0
return image