format()
is way better than %
in many different ways. One of those is:>>> names = ['ali', 'reza', 'alireza', 'mohsen']
>>> print map('Hello Mr. {}'.format, names)
['Hello Mr. ali', 'Hello Mr. reza', 'Hello Mr. alireza', 'Hello Mr. mohsen']
#python #format #string_formatter #map