Generalized range

Michael Hoffman cam.ac.uk at mh391.invalid
Thu Apr 26 15:55:43 EDT 2007


Michael Hoffman wrote:
 > How about something like this:
> 
> index = 0
> while res < maximum:
>     yield minimum + (step * index)
>     index += 1

Well it really would have to be something LIKE that since I never 
defined res. Let's try that again:

index = 0
res = minimum
while res < maximum:
     yield res
     res = minimum + (step * index)
     index += 1
-- 
Michael Hoffman



More information about the Python-list mailing list