New Python 3.0 string formatting - really necessary?

r rt8396 at gmail.com
Sun Dec 21 00:34:27 CET 2008


Walter,

Would you be kind enough to translate this code to the new syntax?

>>> s = 'python'
>>> n = 12
>>> f = 1.333333333
>>> '%s %05d %0.2f' %(s,n,f)
'python 00012 1.33'

i want to see how casting is handled. Thanks



More information about the Python-list mailing list