One is the expression :
‘%.2f’ % num
stay Python2.x and 3.x All available
The other is the method of string object :
‘{0:.2f}’.format(num)
only Python3.x You can use
Example
#A.py
w = 1
print('%.2f' %w)
print({:.2f}.format(w))
Two print All outputs are the same , Just one that uses expressions , A method called ,
Both are reserved for two decimal places