f-Strings¶
Formatted string literals or just f-strings are a new and improved way to format strings in Python. They are available since Python 3.6.
Example:
a = "Hello"
b = "World"
print(f"{a} {b}")
print(f"{a.lower()} {b}")
Formatted string literals or just f-strings are a new and improved way to format strings in Python. They are available since Python 3.6.
Example:
a = "Hello"
b = "World"
print(f"{a} {b}")
print(f"{a.lower()} {b}")