First of all, note that this is from Python 3.6.
a = 20
s = "you are{}age".format(a)
↓
a = 20
s = f"you are{s}age"
Attach f to the end of the string
of course
a = 20
s = f"you are{s+2}age"
You can also write calculations and Python code in curly braces.
Recommended Posts