Articles → Python → String Formatting In PythonString Formatting In PythonIn this article, we will discuss about string formatting in python.Syntax Following syntax is used for string formatting“string %s“ % (variable_name) # string or “string %d“ % (variable_name) # integerExample print ("My Name is %s and my age is %d" % ("Karan",35))Run the above code and you will get following outputClick to EnlargePosted By - Karan Gupta Posted On - Monday, February 11, 2019 Query/Feedback Your Email Id Subject Query/Feedback Characters remaining 250
“string %s“ % (variable_name) # string or “string %d“ % (variable_name) # integer
print ("My Name is %s and my age is %d" % ("Karan",35))
Query/Feedback