Home / MCQ Bank / Computer
Computer Concept Of Object Oriented Programs In Python

What will be the output of the following Python code? class A: def __init__(self,x=3): self._x = x class B(A): def __init__(self): super().__init__(5) def display(self): print(self._x) def main(): obj = B() obj.display() main()

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option A • 5

Related Computer Questions

What is the purpose of the pending keyword in RSpec? The following applications may appear on system tray except How many types do functions fall depends on modularization? Which access specifier allows members of a class to be accessed from anywhere in the program in C++? Given the following adjacency matrix of a graph(G) determine the number of components in the G. [0 1 1 0 0 0], [1 0 1 0 0 0], [1 1 0 0 0 0], [0 0 0 0 1 0], [0 0 0 1 0 0], [0 0 0 0 0 0].