string format in python 3 code example
Example 1: python fstring
#python3.6 is required
age = 12
name = "Simon"
print(f"Hi! My name is {name} and I am {age} years old")
Example 2: new python string formatting
>>> f'Hello, {name}!'
'Hello, Bob!'
#python3.6 is required
age = 12
name = "Simon"
print(f"Hi! My name is {name} and I am {age} years old")
>>> f'Hello, {name}!'
'Hello, Bob!'