Lesson 12: f-strings — Embedding Variables in Text
An f-string is a string that starts with f before the quotes. Inside curly braces {} you can embed variables directly.
Instead of "Hi " + name + "!" we write f"Hi {name}!". Shorter and easier to read.
- f-string
- A formatted string embedding variables with {}.