Vidyalelo
Python · Q116

MCQs for Python Strings: Exam

Programming · Python · question 116

Q116

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

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board