In this example we will show how to use named indexes when using the format() method in Python.
Source Code
name = 'Jim'
age = 16
city = 'New York'
print('I am {name}, {age} years old, from {city}.'.format(name=name, age=age, city=city))
Output:
I am Jim, 16 years old, from New York.