What
f-strings are a convenient way to format strings in Python. You can do a lot of useful things with f-strings so should read the official Python documentation or the f-string cheat sheet for more detail.
Why
f-strings allow the creation of strings composed of different data types without the need for casting.
f-strings are almost always a better choice than passing multiple arguments to print(); they are also almost always a better choice than using concatenation.
Examples
Combine strings
forename = "Richard"
surname = "Tape"
fullname = f"{forename} {surname}" # "Richard Tape"
greeting = f"Hello {fullname}" # "Hello Richard Tape"Mix data types
height = 1.75
age = 18
name = "Clytemnestra"
message = f"{name} is {height}m tall and {age} years old"
# "Clytemnestra is 1.75m tall and 18 years old"Mix data types and string operations
forename = "Ophelia"
surname = "Baggins"
class_year = 22
username = f"{class_year}{forename[0].lower()}{surname.lower()}"
# "22obaggins"Format number to 2 decimal places
pi = 3.14159
message = f"pi to 2 decimal places is {pi:.2f}"
# "pi to 2 decimal places is 3.14"Things you should know
f-string != concatenation
f-strings are not a substitute for concatenation as they work in fundamentally different ways. If you are instructed to use concatenation in an exam question, you will not get the mark if you use an f-string.