Python 3.4 - Multiple Inheritance

 You can create a class that can draw on other classes to use their functions.

class Mario():
    def move(self):
        print('i am moving')

class Shroom():
    def eat_shrooms(self):
        print('i am big')

class BigMario(Mario, Shroom):
    pass
mario1 = BigMario()

mario1.move()
mario1.eat_shrooms()

https://www.youtube.com/watch?v=YCEVvs5BhpY

Comments

Popular posts from this blog

Pyhton 3.4 - Continue

Conversations Ongoing: Valuing Modernization in Early European History

Conversations Ongoing: A Bunch of Amateurs