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..7a061da1 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,11 +17,11 @@ def display(self): # Deleting the object itself try: print(emp.id) -except NameError: +except AttributeError: print("emp.id is not defined") del emp try: emp.display() # it will gives error after deleting emp except NameError: - print("emp is not defined") \ No newline at end of file + print("emp is not defined")