Skip to content
Advertisement

What does NameError mean in python? [closed]

I cannot get where my error is in my code.

JavaScript

When I try to run this, the NameError happens. I do not know where my error is.

Advertisement

Answer

variables num1 and num2 are defined within the scope of function cauculator but you are accessing them from the global scope where they are not defined. Your code also has some other issues too. here is an edited version of your code:

JavaScript

feel free to ask if need help understanding it.

Advertisement