python format string with variable code example
Example 1: new python string formatting
>>> f'Hello, {name}!'
'Hello, Bob!'
Example 2: str.format python 3
print("Sammy ate {0:f} percent of a {1}!".format(75, "pizza"))
>>> f'Hello, {name}!'
'Hello, Bob!'
print("Sammy ate {0:f} percent of a {1}!".format(75, "pizza"))