From 937f62905b821a8cd454cbfb9ac15192a317044f Mon Sep 17 00:00:00 2001 From: "Kaza.Sunitha" <133480054+Kazasunitha@users.noreply.github.com> Date: Sun, 19 May 2024 10:47:02 +0530 Subject: [PATCH] Update classes.md --- contrib/advanced-python/classes.md | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/contrib/advanced-python/classes.md b/contrib/advanced-python/classes.md index 7a2b6b4..1ea529a 100644 --- a/contrib/advanced-python/classes.md +++ b/contrib/advanced-python/classes.md @@ -204,15 +204,8 @@ class Derived(Base): # Driver code obj1 = Base() print(obj1.a) - -# Uncommenting print(obj1.c) will -# raise an AttributeError - -# Uncommenting obj2 = Derived() will -# also raise an AttributeError as -# private member of base class -# is called inside derived class - +# output + It will raises error because private members cannot be used outside the class even not for derived classes **Inheritence** ->Inheritance allows us to define a class that inherits all the methods and properties from another class. @@ -452,4 +445,4 @@ Ostriches cannot fly. - \ No newline at end of file +