force two decimal places python

print ("{0:.2f}".format(a)) 

Here is what the above code is Doing:
1. We are using the string format() method to print the floating point number to 2 decimal places.
2. We are using the format specifier {0:.2f} to specify how many decimal places we want to print.
3. The number before the colon (:) is the index of the argument that we want to print.
4. The number after the colon (:) is the number of decimal places we want to print.
5. The f at the end of the format specifier stands for floating point number.