On Jul 17, 3:10 am, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: > output = '%d foo %d bar" % (foo_count, bar_count), > why we need to use %d? I'm thinking some general common placeholder, > say %x (currently it's hex..) could be used.
You already answered it in the parenthesized remark: the %d placeholder is not only type bound but provides an additonal distinction e.g. the one between decimals and hexadecimals. The kind of general placeholder you want %x being requested for is actually %s which formats decimals quite well unless you want leading zeros. -- http://mail.python.org/mailman/listinfo/python-list