degrees and radians.

Simon Foster simon at nospam.demon.co.uk
Sun May 5 16:36:07 EDT 2002


"Jim Richardson" <warlock at eskimo.com> wrote in message
news:oj04ba.tnb.ln at 127.0.0.1...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Sun, 5 May 2002 15:43:14 +0100,
>  Simon Foster <simon at nospam.demon.co.uk> wrote:
> >
> > "Jim Richardson" <warlock at eskimo.com> wrote in message
> > news:tvl2ba.4q7.ln at 127.0.0.1...
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA1
> >>
> >
> > ...
> >
> >>
> >> Well, now that I have conquered elementry trig, I am now going to try
> >> for simple python and figure out how to add the contents of a tuple to
> >> the contents of another tuple...
> >>
> >
> > Try '+'
> >
> >>>> a
> > (1, 2)
> >>>> b
> > (3, 4)
> >>>> a+b
> > (1, 2, 3, 4)
> >>>>
> >
> >
>
>
> 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)
>
>
> if that makes sense, I don't want to append, I want to add.
>

>>> a
(1, 2)
>>> b
(3, 4)
>>> [ x + y for x, y in  zip( a, b ) ]
[4, 6]
>>>







More information about the Python-list mailing list