Learning Python 18

python

Inheritance

Link to my github (This is learning code.)

app.py

from inheritance.Chef import Chef
from inheritance.ChineseChef import ChineseChef


myChef = Chef()
myChef.make_chichen()
myChef.make_special_dish()
myChineseChef = ChineseChef()
myChineseChef.make_chichen()
myChineseChef.make_special_dish()
myChineseChef.make_fried_rice()

Chef.py

class Chef:

    def make_chichen(self):
        print("The che makes a chicken")

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

    def make_special_dish(self):
        print("The chef make a special dish")

ChineseChef.py

from inheritance.Chef import Chef


class ChineseChef(Chef):

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

    def make_fried_rice(self):
        print("The chef makes fried rice")


Link To Mike Dane YouTuBe