F-strings (formatted strings) can inject arbitrary code expressions into strings without pesky manual terminations and concatenations.
To start an f-string, simply place an f in front of a single-quoted string:
f'Hello!'
To inject code, use <> tags to enclose your expression:
F-strings (formatted strings) can inject arbitrary code expressions into strings without pesky manual terminations and concatenations. To start an f-string, simply place an
f
in front of a single-quoted string:f'Hello!'
To inject code, use
<>
tags to enclose your expression:f'The value of variable a is: <a>.'