Peter Hansen wrote:
>
> Ivan Van Laningham wrote:
> > I can see that now. I had three hours sleep last night and my brain
> > hurts, so I don't get it. I seek enlightenment.
>
> So do I: did you mean you don't even "get" what
> my code is doing...?
Yes. I barely remember my own name right n
Ivan Van Laningham wrote:
I can see that now. I had three hours sleep last night and my brain
hurts, so I don't get it. I seek enlightenment.
So do I: did you mean you don't even "get" what
my code is doing, or you don't get what the OP
really wanted, or something else?
(My sample works only beca
Hi All--
Peter Hansen wrote:
>
> > Define "works":
>
> >>> a = (1,2,3)
> >>> b = ('a','b','c')
> >>> c = (None, 'foo', 3.14)
> >>> tup1 = (1,2,3)
> >>> tup2 = ('a','b','c')
> >>> tup3 = (None, 'foo', 3.14)
> >>> for a,b,c in (tup1,tup2,tup3):
> ... print a
> ... print b
> ... print
Ivan Van Laningham wrote:
"R. C. James Harlow" wrote:
On Monday 25 April 2005 14:34, Ivan Van Laningham wrote:
"R. C. James Harlow" wrote:
or just:
for a,b,c in (tup1, tup2, tup3):
print a
print b
print c
And this works in Python version???
Ah, reading the replies to the original post, thi
Hi All--
"R. C. James Harlow" wrote:
>
> On Monday 25 April 2005 14:34, Ivan Van Laningham wrote:
> > Hi All--
> >
> > "R. C. James Harlow" wrote:
> > > or just:
> > >
> > > for a,b,c in (tup1, tup2, tup3):
> > > print a
> > > print b
> > > print c
> >
> > And this works in Python ver
On Monday 25 April 2005 14:34, Ivan Van Laningham wrote:
> Hi All--
>
> "R. C. James Harlow" wrote:
> > or just:
> >
> > for a,b,c in (tup1, tup2, tup3):
> > print a
> > print b
> > print c
>
> And this works in Python version???
Ah, reading the replies to the original post, this works
Hi All--
"R. C. James Harlow" wrote:
>
> or just:
>
> for a,b,c in (tup1, tup2, tup3):
> print a
> print b
> print c
>
And this works in Python version???
Metta,
Ivan
--
Ivan Van Laningham
God N Locomotive Works
http://www.andi-holmes.co
On Monday 25 April 2005 04:20, James Stroud wrote:
> for a,b,c in zip(tup1, tup2, tup3):
>print a
>print b
>print c
or just:
for a,b,c in (tup1, tup2, tup3):
print a
print b
print c
pgpJ0RNTnCUA3.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/
Harlin Seritt wrote:
I have three tuples of the same size: tup1, tup2, tup3
I'd like to do something like this:
for a,b,c in tup1, tup2, tup3:
print a
print b
print c
Of course, you get an error when you try to run the pseudocode above.
What is the correct way to get this done?
For somethi
Thank you Mr. Stroud.
--
http://mail.python.org/mailman/listinfo/python-list
Harlin Seritt wrote:
I have three tuples of the same size: tup1, tup2, tup3
I'd like to do something like this:
for a,b,c in tup1, tup2, tup3:
print a
print b
print c
Presuming that you want a,b,c to be corresponding entries from the three tuples, then zip() is your
friend:
for a,b,c in z
Harlin Seritt wrote:
I have three tuples of the same size: tup1, tup2, tup3
I'd like to do something like this:
for a,b,c in tup1, tup2, tup3:
print a
print b
print c
Of course, you get an error when you try to run the pseudocode above.
What is the correct way to get this done?
for a, b, c
for a,b,c in zip(tup1, tup2, tup3):
print a
print b
print c
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
I have three tuples of the same size: tup1, tup2, tup3
I'd like to do something like this:
for a,b,c in tup1, tup2, tup3:
print a
print b
print c
Of course, you get an error when you try to run the pseudocode above.
What is the correct way to get this done?
Thanks,
Harlin
--
http://
14 matches
Mail list logo