Dictionary-Based String Formatting : Format : String PYTHON TUTORIALS


PYTHON TUTORIALS » String » Format »

 

Dictionary-Based String Formatting


reply = """
Greetings...
Hello %(name)s!
Your age squared is %(age)s
"""

values = {'name': 'Bob', 'age': 40}
print reply % values



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo String
» Format