some simple numerical programs built-in function xrange instead of rangesince xrange generates the values only as they are needed by the for loop consider the code for in range( )print it prints nowthink about the code for in range( )print it raises the question of whether changing the value of inside the loop affects the number of iterations it does not the range function in the line with for is evaluated just before the first iteration of the loopand not reevaluated for subsequent iterations to see how this worksconsider for in range( )for in range( )print it prints because the range function in the outer loop is evaluated only oncebut the range function in the inner loop is evaluated each time the inner for statement is reached the code in figure reimplements the exhaustive enumeration algorithm for finding cube roots the break statement in the for loop causes the loop to terminate before it has been run on each element in the sequence over which it is iterating when executeda break statement exits the innermost loop in which it is enclosed in python range behaves the way xrange behaves in python