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

New Ways of Conversing: The Kindle 2 and what I think it means

Huddled Masses Yearning: Teach the Controversy

Conversations Ongoing: A Bunch of Amateurs