Python Print different ways.

Insha.
May 6, 2021
#%d%s%f
print(“%d is the integer form of %.2f and the string %s”%(12,12.07666,”pythonstr”))
#second type of print form
print(“{} is the integer form of {} and the string {}”.format(12,12.07666,”pythonstr”))
#third type of print form(Reodering)
print(“{1} is the integer form of {0} and the string {2}”.format(12,12.07666,”pythonstr”))
#Fourth type of print form(Reodering with keyword)
print(“{a} is the integer form of {b} and the string {c}”.format(c=12,a=12.07666,b=”pythonstr”))

--

--