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 +