degrees and radians.

Jim Richardson warlock at eskimo.com
Wed May 8 01:53:24 EDT 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 7 May 2002 17:46:39 -0700,
 Andrae Muys <amuys at shortech.com.au> wrote:
> Jim Richardson <warlock at eskimo.com> wrote in message news:<oj04ba.tnb.ln at 127.0.0.1>...
>> sorry, I wasn't very clear, in the above example, the result I am
>> looking for is
>> 
>> >>>a=(1,2)
>> >>>b=(2,3)
>> >>>a+b
>> (3,5)
>> 
> 
> Well if it's just a one-off you can use a simple list comprehension
> 
> [a+b for a,b in zip(a,b)]
> [3,5]
> 
> if you specifically need a tuple then wrapping the above in tuple()
> will do the conversion.
> 
> However if this is likely to be a common task (as I suspect), then you
> are better off using Numeric as suggested, or (less likely) rolling
> your own class.
> 
> Andrae Muys


I am going to look into numeric thanks, and also zip, I don't recal this
from 1.5? is it new with 2.0? 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE82L1Ud90bcYOAWPYRAuLwAJ44s0WfeNqPeio5z/vjwj+u1NoHrwCgijpn
Kip+FQUnQoHEli8vERJ6zjw=
=YhR/
-----END PGP SIGNATURE-----

-- 
Jim Richardson
	Anarchist, pagan and proud of it
http://www.eskimo.com/~warlock
Linux, from watches to supercomputers, for grandmas and geeks. 



More information about the Python-list mailing list