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

Solution: Import the 'not_' module

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

 

For more information:
operator not_