How to Solve NameError: name 'gt' is not defined -- operator

Solution: Import the 'gt' module

# Add the following line to the top of your code
from operator import gt

 

For more information:
operator gt