GATE DA Python OOP, Modules & Exception Handling | Set 1

Questions 46-50 of 100

0% completed (0/100 answered)
Your score 0/100 0 answered
Correct 0 Incorrect 0 Unanswered 100 Accuracy 0%

Question 46

MSQ · Multiple Correct 1 mark

Which of the following statements about inheritance and MRO in Python are CORRECT?

Answers for question 46

Question 47

NAT · Numerical Answer 1 mark
PYTHON
What is the value printed?
class Base:
 def msg(self):
 return 5
class Derived(Base):
 def msg(self):
 return super().msg() * 3

$d = Derived()
print(d.msg())$

Answers for question 47

Question 48

MCQ · Single Correct 1 mark

In Python, if class Child(Parent1, Parent2) is defined, which parent class's attribute is searched first?

Answers for question 48

Question 49

NAT · Numerical Answer 1 mark
PYTHON
Evaluate:
class A:
 st = 100
class B(A):
 pass
class C(B):
 pass

C.st = 200
print(A.st)

Answers for question 49

Question 50

MCQ · Single Correct 1 mark

What is the result of calling isinstance(True, int)?

Answers for question 50
Scroll to Top