F-string in python

 F-string in python



The idea behind f-strings is to make string interpolation simpler. To create an f-string, prefix the string with the letter “ f ”. F-strings provide a concise and convenient way to embed python expressions inside string literals for formatting. 

a=23
b="my"
c=f"{b} age is {a}" # f is prefixed to string
print(c)

Comments