Python 3.4 - Inheritance

Objects can inherit functions from other classes by grouping them together. Once grouped together the functions of both classes can be called upon. 

class Parent():

    def print_last_name(self):
        print('Fassnacht')


class Child(Parent):

    def print_first_name(self):
        print('Matt')

child1 = Child()

child1.print_first_name()
child1.print_last_name()


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

Comments

Popular posts from this blog

Pyhton 3.4 - Continue

Conversations Ongoing: Valuing Modernization in Early European History

Conversations Ongoing: A Bunch of Amateurs