class Human():
def __init__(self, name, age):
self.name = name
self.age = age
def hablar(self, message):
print(message)
class Alien(Human):
def __init__(self, planet):
self.planet = planet
def fly(self):
print("I'm flying!")
This code is an example to show what I want to do. Imagine that I want an alien to inheritance all the properties of a Human but I also want him to have a planet attribute to distinguish from which planet does it comes.
When I do it as I did it in the mentioned code, it didn't work. Is it possible to do it? How?
Thanks!