[Tutor] [newbie] output formatting

Gregor Lingl glingl at aon.at
Wed Nov 5 09:14:38 EST 2003



Eur van Andel schrieb:

> ...
>
>>0	The conversion will be zero padded for numeric values.
>>    
>>
>
>but it doesn't work:
>
>  
>
>>print '%02.2f, %02.2F'% (T1, T2)
>>3.14, 3.14
>>    
>>
 >>> from math import pi
 >>> print '%06.2f, %06.2F'% (pi,pi)
003.14, 003.14
 >>> print '%6.2f, %6.2F'% (pi,pi)
  3.14,   3.14
 >>>

>Life is hard for Python newbies :-(
>  
>
Not really, as there ist the Tutor - List ;-)

Gregor

P.S.: Perhaps you additionally will like

http://rgruet.free.fr/PQR2.3.html

a Python Quick Reference.




More information about the Tutor mailing list