Skip to content

Instantly share code, notes, and snippets.

@Abhayparashar31
Last active December 15, 2020 12:49
Show Gist options
  • Save Abhayparashar31/e276cdff4abb99969fff8f889b699aff to your computer and use it in GitHub Desktop.
Save Abhayparashar31/e276cdff4abb99969fff8f889b699aff to your computer and use it in GitHub Desktop.
from abc import ABC, abstractmethod
class Fruit(ABC):
# abstract method
def noofsides(self):
pass
class Orange(Polygon):
# overriding abstract method
def method(self):
print("I am Juicy")
class Apple(Polygon):
# overriding abstract method
def method(self):
print("I am tasty")
# Driver code
R = Apple()
R.method()
K = Orange()
K.method()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment