How to format string output in Python

If you want to make string to format output in python.You can try source code below:

code one:

 m = 'python'
 astr = 'i love %s' % m
 print astr

code two:

 m = 'python'
 astr = "i love {python}".format(python=m)
 print astr

code three:

 m = 'python'
 astr = "i love %(python)s " % {'python':m}
 print astr

,