Home Browser Contributors

f-strings

f-strings are a clean way of referencing variables and or the return value of a function in a string. To specify a string as an f-string by putting an f before quotes. f-strings can be used with both double and single quotes. To define a variable or function return value you surround the variable or function in currly brackets.

Example

``` py import os print(f"Current user: {os.getlogin()}") ```