polymorphism in python

technical talkiess
0

 Polymorphism in python


class Emploee:

    no_leave = 10


    def leave_balance(self):

        return f"The balance of employee is 10"

   



class Teacher(Emploee):

    no_of_leave_teacher = 20

    # inheritance ki class ke function,method , attribute ko inherit class me change karna iska matlab polymorphism hota hai

   

    def leave_balance(self):

        return f"The leave balance of teacher is 20"

   


student = Emploee()

print(student.leave_balance())

teacher = Teacher()

print(teacher.leave_balance())

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)