+ 4
Yeah. x = 42 y = f'Number is {x}.' print(y) # Output: Number is 42.
9th Mar 2020, 4:29 PM
HonFu
HonFu - avatar
0
f marks a so-called formatstring. If there's an f in front of the literal, everything in {} will be evaluated and inserted into the string. There's also the more conventional and sometimes helpful method format that works comparably: print('Number is {}'.format(x))
9th Mar 2020, 5:20 PM
HonFu
HonFu - avatar