Python f-strings: Everything You Need to Know (With Examples) f-strings (formatted string literals) have been in Python since 3.6. They're faster than .format() , more readable than % formatting, and support any expression inline. Here's everything they can do. 🎁 Free: AI Publishing Checklist — 7 steps in Python · Full pipeline: germy5.gumroad.com/l/xhxkzz (pay what you want, min $9.99) The basics name = " Alice " age = 30 # f-string (modern) print ( f " Hello, { name } ! You are { age } years old. " ) # .format() (older) print ( " Hello, {}! You are {} years old. " . format ( name , age )) # % formatting (oldest) print ( " Hello, %s! You are %d years old. " % ( name , age )) Enter fullscreen mode Exit fullscreen mode Any variable or expression inside {} is evaluated and inserted.…