[Tutor] floating point range() ?

Lloyd Kvam 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)
>     j=float(i)/10
>     print j
> 
> The above works but seems clumbsy.
> 
> Is there a better way ?
> 
> Dave
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
-- 

Lloyd Kvam
Venix Corp.
1 Court Street, Suite 378
Lebanon, NH 03766-1358

voice:	603-653-8139
fax:	801-459-9582




More information about the Tutor mailing list