Saved Bookmarks
| 1. |
How do we implement abstract method in python? Give an example for the same. |
|
Answer» Abstract method: An unimplemented method is called an abstract method. When an abstract method is declared in a base class the derived class has to define the method or raise “Notimplemented Error” Or Abstract Method can be used to enable parent class method execution. Class Shape (object): def findArea (self): pass Class Square (Shape): def init (self, side): self, side = side def findArea self.side*self.side |
|