excord80 wrote:
On Dec 19, 11:01 am, walterbyrd <walterb...@iname.com> wrote:
To me, it seems that this:
  print "%s=%d" % ('this',99)
Is much easier, ...
This (if it's right) is much longer, ...
print( "{0}={1}".format('this',99))
Yeah, I like the old way better too. It's got this nice elegant
simplicity to it (using the percent sign for not only the things
inside the string, but also to separate it from the tuple that
follows). Also, I like having only *one* special symbol (`%') to worry
about in my strings instead of two (`{' and `}').

Ah, but for internationalization, you can change the format
string to take args in a different order if, for example,
French messages want modifiers on one side and English on the other.
The code can stay the same, while only the text used to do the
formatting must change.

--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to