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

Solution: Import the 'add' module

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

 

For more information:
operator add