Quick Quiz!

Test your understanding of the concept of polymorphism by taking a short quiz.

1

What is the output of the following piece of code?

class Parent:
    def prn(self):
        print("Parent")


class Child(Parent):
    def __init__(self):
        self.a = Parent()

    def prn(self):
        print("Child")


temp = Child()
temp.a.prn()

A)

Child

B)

Child
Parent

C)

Parent

D)

Compilation error

Question 1 of 50 attempted

Get hands-on with 1200+ tech skills courses.