Quick Quiz!

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

We'll cover the following...
Technical 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


1 / 5