# inheritance2.py

class Insect:
    def __init__(self):
        self.numLegs = 6
        self.hasWings = False
        self.motion = 'crawl crawl'

    def move(self):
        print(self.motion)

class Spider(Insect):
    def __init__(self):
        Insect.__init__(self)
        self.numLegs = 8

class Butterfly(Insect):
    def __init__(self):
        Insect.__init__(self)
        self.hasWings = True
        self.motion = 'flap flap'

# What is printed?

I = Insect()
S = Spider()
B = Butterfly()

print( "Insect:" )
print( "Has %s legs" % I.numLegs )
print( "Has wings: %s" % I.hasWings )
I.move()

print( "Spider:" )
print( "Has %s legs" % S.numLegs )
print( "Has wings: %s" % S.hasWings )
S.move()

print( "Butterfly:" )
print( "Has %s legs" % B.numLegs )
print( "Has wings: %s" % B.hasWings )
B.move()