To print Python print(f-string), you need to enclose each of the variable names inside a set of curly braces.
f"This is an f-string {var_name} and {var_name}."
Python print(f-string)
Simple example code Print Variables using Python f-Strings. Just specify the names of the variables inside a set of curly braces {}
. And all variable names will be replaced with their respective values.
name = "John"
age = 32
print(f"I'm {name} age {age}.")
Output:

Do comment if you have any doubts or suggestions on this Python string formatting topic.
Note: IDE: PyCharm 2021.3.3 (Community Edition)
Windows 10
Python 3.10.1
All Python Examples are in Python 3, so Maybe its different from python 2 or upgraded versions.