Examples using format with names
txt = "Foo Bar"
num = 42.12
print("The user {name} was born {age} years ago.".format(name = txt, age = num))
The user Foo Bar was born 42.12 years ago.
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
txt = "Foo Bar"
num = 42.12
print("The user {name} was born {age} years ago.".format(name = txt, age = num))
The user Foo Bar was born 42.12 years ago.