Back to feed

Python F-Strings for String Interpolation and Formatting

Real Python
Python F-Strings for String Interpolation and Formatting

EDITOR BRIEF

Python f-strings offer a readable, concise way to insert values into strings and format the result. The excerpt says they are faster than `.format()` and the `%` operator.

INSIGHTS

Clear string formatting makes code easier to read. Try replacing a `.format()` call in a small Python program with an f-string.

CodeFriends courses that build on this story. Practice in the browser with nothing to install.

COMMENTS

0/40
0/2000

Loading comments…