Examveda

What will be the output of the following Python code?
class father:
    def __init__(self, param):
        self.o1 = param
 
class child(father):
    def __init__(self, param):
        self.o2 = param
 
>>>obj = child(22)
>>>print "%d %d" % (obj.o1, obj.o2)

A. None None

B. None 22

C. 22 None

D. Error is generated

Answer: Option D


This Question Belongs to Python Program >> Strings In Python

Join The Discussion

Related Questions on Strings in Python