What exception will be raised when you refer to a variable that has not yet been defined?

Questions & AnswersCategory: PythonWhat exception will be raised when you refer to a variable that has not yet been defined?
Lokesh Kumar Staff asked 2 years ago
1 Answers
Lokesh Kumar Staff answered 2 years ago

d. NameError
 
Explanation:

NameError is raised when a local or global name is not found. This applies only to unqualified names. The associated value is an error message that includes the name that could not be found.