ExamVeda
Login
Home
61
What will be the output of the following Python code?
class Demo:
     def __init__(self):
         self.a = 1
         self.__b = 1
     def get(self):
         return self.__b
obj = Demo()
obj.a=45
print(obj.a)
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
62
What will be the output of the following Python code?
class fruits:
    def __init__(self):
        self.price = 100
        self.__bags = 5
    def display(self):
        print(self.__bags)
obj=fruits()
obj.display()
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
63
Method issubclass() checks if a class is a subclass of another class.
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
64
What will be the output of the following Python code?
class Demo:
     def __init__(self):
         self.a = 1
         self.__b = 1
 
     def get(self):
         return self.__b
 
obj = Demo()
print(obj.get())
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
65
What will be the output of the following Python code?
class A:
    def __init__(self):
        self.multiply(15)
        print(self.i)
 
    def multiply(self, i):
        self.i = 4 * i;
class B(A):
    def __init__(self):
        super().__init__()
 
    def multiply(self, i):
        self.i = 2 * i;
obj = B()
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
66
Methods of a class that provide access to private members of the class are called as . . . . . . . . and . . . . . . . .
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
67
Which principle of OOP is associated with the concept of "IS-A" relationship?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
68
What will be the output of the following Python code?
class A:
    def __init__(self):
        self.multiply(15)
    def multiply(self, i):
        self.i = 4 * i;
class B(A):
    def __init__(self):
        super().__init__()
        print(self.i)
 
    def multiply(self, i):
        self.i = 2 * i;
obj = B()
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
69
Which of the following statements is true?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
70
What will be the output of the following Python code?
class A():
    def disp(self):
        print("A disp()")
class B(A):
    pass
obj = B()
obj.disp()
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board