Skip to content

xfrange()

Step through evenly spaced numbers one at a time, allowing fractional steps.

xfrange(start, stop, step)

A generator version of frange(): instead of building the whole list at once, it produces each number as you loop over it. This is handy for long ranges. As with range(), stop is not included, and step may be negative to count down.

Parameters

xfrange(start, stop, step)
Parameter Type Default Description
start int or float required The first number.
stop int or float required The number to stop before (not included).
step int or float required The gap between numbers; may be negative to count down. Must not be zero.

Returns

return value

Value Type Description
value float The next number in the sequence, each time through the loop.