1

What will be the output of the following Python code? 1. class father: 2. def __init__(self, param): 3. self.o1 = param 4. 5. class child(father): 6. def __init__(self, param): 7. self.o2 = param 8. 9. >>>obj = child(22) 10. >>>print "%d %d" % (obj.o1, obj.o2)

Correct Answer: error is generated

Make the most of this question

This page focuses on one Problem Solving and Python Programming question from Engineering. After checking the answer, return to the topic list to practice more or run a timed set.

Problem Solving and Python Programming MCQ: What will be the output of the following Python code? 1. class father: 2. def __init__(self, param): 3. self.o1 = param 4. 5. class child(father): 6. def __init__(self, param): 7. self.o2 = param 8. 9. >>>obj = child(22) 10. >>>print "%d %d" % (obj.o1, obj.o2) | Extra Education