Python Override Method Addition || Polymorphism || Python

In this we are going to see a program about Python Override Method Addition in Python Programming Language.


class Employee:

    def add(self, a, b):
        print('The Sum of Two = ', a + b)


class Department(Employee):

    def add(self, a, b, c):
        print('The Sum of Three = ', a + b + c)


emp = Employee()
emp.add(10, 20)

print('------------')
dept = Department()
dept.add(50, 130, 90)

# Coded By Dhiraj Shelke

#ENJOY CODING

Post a Comment

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

Previous Post Next Post