How to Solve NameError: name 'statistics' is not defined

Solution: Import the 'statistics' module

To Solve the error, add the following line to the top of your code.

import statistics

 

For more information:
Python statistics