What is wrong in this piece of code?
dic = { \'fruit\': \'apple\', \'place\':\'table\' } test = \"I have one {fruit} on the {place}.\".format(dic) print(test) &
You can use the following code too:
dic = { 'fruit': 'apple', 'place':'table' } print "I have one %(fruit)s on the %(place)s." % dic
If you want to know more about format method use: http://docs.python.org/library/string.html#formatspec