fstring in the python

technical talkiess
0

 # f - string tutorial 

a = "Vishal "

b = 26

# first method to bind the variable

# c = "This is %s "%a

# second method to bind the variable

# c = "This is %s and age is %s"%(a,b)

# third method to bind the variable 

# c = f"This is {a} and age is {b}"

#forth method is 

c = "This is {} and age is {}"

print(c.format(a,b))

Tags

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)