String Formatting with Dictionaries : Format : Dictionary PYTHON TUTORIALS


PYTHON TUTORIALS » Dictionary » Format »

 

String Formatting with Dictionaries


After the % character, you add a key enclosed in parentheses, which is followed by the other specifier elements: 

phonebook = {'A''1''B''2''C''3'}
print "C's phone number is %(C)s." % phonebook



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Dictionary
» Format