how format specifier taking value while tuple list is passed
问题 I have a piece of code as below: tupvalue = [('html', 96), ('css', 115), ('map', 82)] So while printing the above tuple in the desired format for a particular index I found a code like this: >>> '%s:%d' % tupvalue[0] 'html:96' I'm wondering how the single value tupvalue[0] is recognised as a tuple of two values by the format specifier '%s:%d' ? Please explain this mechanism with a documentation reference. How can I use a comprehension to format all the values in tupvalue in the required