[Tutor] range()-like function for dealing with floats...?

Carroll, Barry Barry.Carroll at psc.com
Fri Mar 30 20:11:07 CEST 2007


> -----Original Message-----
> Date: Fri, 30 Mar 2007 14:47:26 +0530
> From: "Joydeep Mitra" <snakepit.rattlesnakes at gmail.com>
> Subject: [Tutor] range()-like function for dealing with floats...?
> To: tutor at python.org
> Message-ID:
> 	<972566ff0703300217o7a916d89v565e78a5f1e479ec at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Hi all,
> I need to generate a sequence of real numbers that are evenly spaced.
I
> have
> used loops for this purpose until now, but it gets kinna messy when
you
> gotta do it a number of times in a program.
> The range function, as per my knowledge, accepts parameters and return
> values only as integers.
> Is there a function in python, which performs the task of the range()
> function with floats?
> 
> Joy
Joy:

Try entering "python range float" at your personal favorite search
engine.  I tried it on Google.  Here is the first entry returned:

	ASPN : Python Cookbook : frange(), a range function with float
...
	Sadly missing in the Python standard library, this function
allows 
	to use ranges, just as the built-in function range(), but with 
	float arguments. ...
	aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66472 
	- 32k - Cached - Similar pages 

There were lots of others.  

Regards,
 
Barry
barry.carroll at psc.com
541-302-1107
________________________
We who cut mere stones must always be envisioning cathedrals.

-Quarry worker's creed




More information about the Tutor mailing list