Data Abstraction with Constructors using Inheritance in Python - 1 || Data Abstraction || Python 

In this we are going to see a program on Data Abstraction with Constructors using Inheritance in Python - Type 1 in Python Programming Language.


class Human:
    def work(self):
        pass


class Farmer(Human):
    def work(self):
        print("Grows Crops")


class Plumber(Human):
    def work(self):
        print("Repairs pipes")


f = Farmer()
f.work()

p = Plumber()
p.work()

# Coded by Saahil

#ENJOY CODING

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post