Articles → Python → String Formatting In PythonString Formatting In PythonIn this article, we will discuss string formatting in Python.Syntax The 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))Output Posted 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