python print array decimal places code example
Example 1: print 2 decimal places python
print("{0:.2f}".format(sum(query_marks)/len(query_marks)))
Example 2: sorting decimal numbers in python
list1.sort(key=float)
print("{0:.2f}".format(sum(query_marks)/len(query_marks)))
list1.sort(key=float)