how to print answer 2 decimal places in python 3

print("{0:.2f}".format(sum(query_marks)/len(query_marks)))

Here is what the above code is Doing:
1. We’re using the sum function to sum up all the marks in the query_marks list.
2. We’re using the len function to get the length of the query_marks list.
3. We’re using the format function to format the output.
4. We’re using the print function to print the output.