Articles → Python → Format Function In Python

Format Function In Python






Purpose





Example




Name = “Karan”




print("My Name is ",name)




print("My Name is {}".format(name))




print("this is {} and another {}".format("placeholder1", "placeholder2"))




Picture showing the output of format function in python






print("this is {one} and another {two}".format(one = "placeholder1", two = "placeholder2"))




Picture showing the output of format function in python



Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, March 5, 2019

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250