Name Error (नेम एरर) :-
NameError तब आती है जब Program में किसी ऐसे Variable, Function या Object का उपयोग किया जाता है जिसे Python पहचान नहीं पाता। इसका मुख्य कारण यह होता है कि वह नाम (Name) पहले Define नहीं किया गया होता या गलत लिखा गया होता।
English:
A NameError occurs when a program tries to use a variable, function, or object that Python cannot recognize. This usually happens because the name has not been defined or is misspelled.
Wrong Example 1: Undefined Variable :-
Output:
Correct Example
Output:
Wrong Example 2: Misspelled Variable Name :-
Output:
Correct Example
Output:
Wrong Example 3: Case Sensitivity :-
Output:
Correct Example -
Output:
Wrong Example 4: Undefined Function :-
Output:
Correct Example
Output: