In this example we will show how to format selected multiple parts of a string using the format() method in Python.
Source Code
name = 'Jim'
age = 16
city = 'New York'
print('I am {}, {} years old, from {}.'.format(name, age, city))
Output:
I am Jim, 16 years old, from New York.