Thanks, got it.
"M.E.Farmer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> It's me wrote:
> > If I have:
> >
> > a = (1,2,3)
> >
> > how do I ended up with:
> >
> > res=[(1), (2), (3), (4), (5)]
> >
> > without doing:
> >
> > res=[(a[0]), (a[1]), (a[2]), (4), (5)]
> >
It's me wrote:
> If I have:
>
> a = (1,2,3)
>
> how do I ended up with:
>
> res=[(1), (2), (3), (4), (5)]
>
> without doing:
>
> res=[(a[0]), (a[1]), (a[2]), (4), (5)]
>
> ???
>
> ps: This is just a nobrainer example of what my real code is trying
to do.
> "a" might have many many eleme
*bonk, bonk, bonk*
Now I feel better.
Thanks, everybody. The "+" is indeed what I was looking for.It just
didn't occur to me that this is the way you concatenate two lists together.
But of course, that makes sense, doesn't it?
Thanks again.
"Peter Hansen" <[EMAIL PROTECTED]> wrote in mes
Peter Hansen wrote:
It's me wrote:
If I have:
a = (1,2,3)
Note that this is a tuple.
how do I ended up with:
res=[(1), (2), (3), (4), (5)]
Not that this is a list. The two aren't the same thing.
I meant to say "Note" here, not "Not"... in case it wasn't
obvious.
-Peter
--
http://m
It's me wrote:
If I have:
a = (1,2,3)
Note that this is a tuple.
how do I ended up with:
res=[(1), (2), (3), (4), (5)]
Not that this is a list. The two aren't the same thing.
If you don't understand the difference, you might want
to review the tutorial or head over to the tutor list.
Also
It's me wrote:
> If I have:
>
> a = (1,2,3)
>
> how do I ended up with:
>
> res=[(1), (2), (3), (4), (5)]
>
> without doing:
>
> res=[(a[0]), (a[1]), (a[2]), (4), (5)]
>
If by (x) you really mean a tuple with 1 element i.e. (x,) then you
need something like this:
>>> a = (1, 2, 3)
>>
If I have:
a = (1,2,3)
how do I ended up with:
res=[(1), (2), (3), (4), (5)]
without doing:
res=[(a[0]), (a[1]), (a[2]), (4), (5)]
???
ps: This is just a nobrainer example of what my real code is trying to do.
"a" might have many many elements. That's why the explicit indexing