From 915a5988dc20e481d9bdcbf7a7860d665cd5875e Mon Sep 17 00:00:00 2001 From: Pradesh Kumar Date: Sun, 24 Mar 2024 17:45:01 +0530 Subject: [PATCH] Fixed exception type --- Basics/Exercise/16_class_and_objects/16_class_and_objects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basics/Exercise/16_class_and_objects/16_class_and_objects.py b/Basics/Exercise/16_class_and_objects/16_class_and_objects.py index 4893cabc..06df70fa 100644 --- a/Basics/Exercise/16_class_and_objects/16_class_and_objects.py +++ b/Basics/Exercise/16_class_and_objects/16_class_and_objects.py @@ -17,7 +17,7 @@ def display(self): # Deleting the object itself try: print(emp.id) -except NameError: +except AttributeError: print("emp.id is not defined") del emp