Mega Code Archive

 
Categories / Python / Development
 

More than one format in the string

#If there is more than one format in the string, you need to pass a tuple as right # operand, as in this example: table = {'A': 4127, 'B': 4098, 'C': 7678} for name, phone in table.items():      print '%-10s ==> %10d' % (name, phone)