show decimal places python code example
Example 1: print 2 decimal places python
print("{0:.2f}".format(sum(query_marks)/len(query_marks)))
Example 2: python 2 decimal places format
"{:.2f}".format(5)
print("{0:.2f}".format(sum(query_marks)/len(query_marks)))
"{:.2f}".format(5)