Esempio n. 1
0
from animal import Animal
from horse import Horse
from pig import Pig

if __name__ == "__main__":
    cow = Animal()
    cow.speak()
    horse = Horse("Bill")
    horse.speak()
    horse2 = Horse("Joe")
    horse.get_name()
    horse2.get_name()
    pig = Pig("Rob")
    pig.speak()
    pig.get_name()
Esempio n. 2
0
from animal import Animal
from dog import Dog
from horse import Horse

a = Animal()
d = Dog()
h = Horse()

a.speak()
a.sleep()

d.speak()
d.sleep()

h.speak()
h.sleep()