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

Solution: Import the 'modes' module

# Add the following line to the top of your code
import modes

 

For more information:
Python modes