How to Solve NameError: name 'getcontext' is not defined -- decimal

Solution: Import the 'getcontext' module

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

from decimal import getcontext

 

For more information:
Python decimal getcontext