How to Solve NameError: name 'system' is not defined -- os

Solution: Import the 'system' module

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

from os import system

 

For more information:
Python os system