Polimorfismo Python
Polimorfismo Python
A R U N A R U N I S T O
Polymorphism in Python refers to the ability
of a function or method to behave
differently depending on the type of object
it is called on. This is achieved through
inheritance, where a child class can override
the methods of its parent class.
class Humans:
def __init__(self, name):
self.name = name
def speak(self):
print("Hi, my name is : ",self.name)
class Lion:
def speak():
print("Roarrrrr......")
class Cat:
def speak():
print("Meowwwww!!")