What Are "F-Strings" in Python?
This lesson is an overview of everything you’ll learn in this course. You will cover old school string formatting, learn why you should consider using f-strings in your code as well as see how to format different types of strings using the f-string formatting style.
00:00 Hi! My name’s Chris Bailey. I’ll be taking you through Python 3’s f-Strings: An Improved String Formatting Syntax Guide. So, why should you use Python 3’s f-strings? They’re more readable, they’re more concise, they’re less prone to error, and faster.
00:13
I’ll start you off in old-school string formatting. The first option is %-formatting. And then, second, I’ll show you str.format()
. Let me start you off with a few examples.
Become a Member to join the conversation.