f-string

f-string in python 3.6

f-string literal

Vikash Kumar

2 minute read

According to python official document, f-string is a string literal that is prefixed with ‘f’ or ‘F’. This was introduced in python 3.6. Apart from usual python string formatting '%s %d' % ('python', 3.6) and the format() method, python 3.6 introduces f-string. Official doc can be found here.