# vars() is the local dictionary containing variables name and age as keys
print("Hello %(name)s, you are %(age)s years old." % vars())
''' result -->
Hello Frank, you are 12 years old.
'''
A little bit more old-fashioned:
import string
name = "Frank"
age = 12
# variables to be substituted begin with a $
t = string.Template("Hello $name, you are $age old!")
# local disctionary vars() contains variables name and age
s = t.substitute(vars())
print(s)
''' result -->
Hello Frank, you are 12 old!
'''
If you have Python273 or Python3, you can use:
name = 'Frank'
age = 12
# vars() is the local dictionary containing variables name and age as keys
# needs Python273 or Python3 and higher
print("Hello {name}, you are {age} years old.".format(**vars()))
''' result -->
Hello Frank, you are 12 years old.
'''