Mega Code Archive
Categories
/
Python Tutorial
/
String
Dictionary-Based String Formatting
reply = """ Greetings... Hello %(name)s! Your age squared is %(age)s """ values = {'name': 'Bob', 'age': 40} print reply % values