Learn about what Python’s formatted string literals (f-strings) are and when to use them. You’ll see that f-strings allow you to use embedded Python expressions inside string constants:
>>> f'Hello, {name}!'
'Hello, Bob!'
This lesson will also show you how to use f-strings for:
- Simple string formatting and
- Inline arithmetic
Stephen Paden on June 27, 2019
This doesn’t work for me for some reason.