Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
What is usage of {} in f string?
1 Resposta
+ 5
Also called āformatted string literals,ā f-strings areĀ string literals that have an f at the beginning and curly braces containing expressions that will be replaced with their values. The expressions are evaluated at runtime and then formatted using the __format__ protocol.
Eg:
x = 7
print (f"T he value of x is {x}")