[Tutor] floating point range() ?
pythonTutor at venix.com
Sat Jun 19 20:34:24 EDT 2004
There is no builtin range for floats. There is a Python Cookbook frange
recipe which could be useful.
An alternative for getting the list is:
[i*.5 for i in range(200)]
On Thu, 2004-06-17 at 13:33, Dave S wrote:
> Is there a floating point range() type builtin ?
> I need to generate a sequence for a 'for loop' every 0.5
> for i in reange(0,1000,5)
> print j
> The above works but seems clumbsy.
> Is there a better way ?
> Tutor maillist - Tutor at python.org
1 Court Street, Suite 378
Lebanon, NH 03766-1358
More information about the Tutor