In this lesson, you’ll learn how to use f-strings, otherwise known as formatted string literals. They are available in Python 3.6 and above.
Here’s an example:
>>> name = "Bob"
>>> age = 10
>>> f"My name is {name}. I am {age} years old."
'My name is Bob. I am 10 years old'
If you want to learn more, check out Python 3’s f-Strings: An Improved String Formatting Syntax.
James Uejio RP Team on April 26, 2020
f-strings were added in 3.6: realpython.com/python-f-strings/