Skip to content

Latest commit

 

History

History
15 lines (10 loc) · 453 Bytes

formatted-string-literal.md

File metadata and controls

15 lines (10 loc) · 453 Bytes

How to Use Formatted String Literals


f-strings

You can include the values of an expression inside a string with Python formatted string literals, also known as f-strings. You have to prefix the string with f or F and write expressions like { expression }.

name = 'Ron'
print(f'Hi {name}! How Are You?')  
#  Hi Ron! How Are You?

link