The 4 in the range function used in the for loop indicates the increment step. suppose the value of height is 20. Then the values for y will be set as 0, 0+4=4, 4+4=8, ... till 20 in subsequent iterations of the for loop.
For a more detailed description of range function check out the python documentation at: http://docs.python.org/2/library/functions.html#range