How to Solve NameError: name 'cos' is not defined -- math

Solution: Import the 'cos' module

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

from math import cos

 

For more information:
Python math cos