xxxxxxxxxx
# Python3 program introducing f-string
val = 'Geeks'
print(f"{val}for{val} is a portal for {val}.")
name = 'Tushar'
age = 23
print(f"Hello, My name is {name} and I'm {age} years old.")
xxxxxxxxxx
>>> class Confused:
def __format__(self, fmt):
return f"What is {fmt}?"
>>> c = Confused()
>>> f"{c:xyz12}"
'What is xyz12?'