> >   >>> for x in ['string', 10, True, [1,2,3] ]:
> >   ...   print '%s' %x
> >   ...
> > string
> > 10
> > True
> > [1, 2, 3]
> 
> That's cool! I didn't know that. I guess I'm crazy... : )
> (We already knew that here.)

The difference is in how the formatting details work.
For numbers the formatting digits indicate precision 
and for strings length.

>>> print "%5.3f" % 123.456
123.4560
>>> print "%5.3s" % 123.456
 123.

produce very different results.

Alan G.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to