Re: [Tutor] print array

2007-09-26 Thread Ricardo Aráoz
Fangwen Lu wrote: > Dear all- > > Let a=(3,4,7), b=[3,4,7]. > If I type > print '%d + %d = %d' %(a) > I get > 3 + 4 = 7 > > But if I type print '%d + %d = %d' %(b), I get errors. > > If there is a way for doing this kind of type dirrectly from array. > print '%d + %d = %d' % tuple(b)

Re: [Tutor] print array

2007-09-26 Thread Eric Brunson
Fangwen Lu wrote: > Dear all- > > Let a=(3,4,7), b=[3,4,7]. > If I type > print '%d + %d = %d' %(a) > I get > 3 + 4 = 7 > > But if I type print '%d + %d = %d' %(b), I get errors. > > If there is a way for doing this kind of type dirrectly from array. No, but it's trivial to convert an array

[Tutor] print array

2007-09-26 Thread Fangwen Lu
Dear all- Let a=(3,4,7), b=[3,4,7]. If I type print '%d + %d = %d' %(a) I get 3 + 4 = 7 But if I type print '%d + %d = %d' %(b), I get errors. If there is a way for doing this kind of type dirrectly from array. Thank you! Fangwen ___ Tutor maillist