Answer the question
In order to leave comments, you need to log in
Does my example have polymorphism?
class A():
def __init__():
pass
def cprint():
print("A")
class B():
def __init__():
pass
def cprint():
print("B")
class C():
def __init__():
pass
def cprint():
print("C")
obj_list = [A, B, C]
for obj in obj_list:
obj.cprint()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question