use of range function in for loop in python