Python - Programming Language
This course covers the basics of programming in Python. Work your way through the videos and we'll teach you everything you need to know to start your programming journey!

Inheritance

Lesson 34
Author : Mike Dane
Last Updated : October, 2017


Code

Copyclass Chef:
   def make_chicken(self):
       print("The chef makes chicken")

   def make_salad(self):
       print("The chef makes salad")

   def make_special_dish(self):
       print("The chef makes bbq ribs")

class ItalianChef(Chef):
   def make_pasta(self):
       print("The chef makes pasta")

   def make_special_dish(self):
       print("The chef makes chicken parm")


myChef = Chef()
myChef.make_chicken()

myItalianChef = ItalianChef()
myItalianChef.make_chicken()