a = 73
b = "%d" % a
print (b)
In this code, what is the format operator, is it the % with d or the % before a.
a = 73
b = "%d" % a
print (b)
In this code, what is the format operator, is it the % with d or the % before a.
Hi, Nikhil.
The “%” before a is called as formatting operator which holds the value of a and “%d” is the formatting string, where the value of the “a” as integer will be replaced.
All the best!