ID:120
i = s = 0
while i <= 3 :
s += i
i = i+1
print(s)
ID:120 - What will be the output of the following?
Anonymous Quiz
39%
A. 3
14%
B. 4
28%
C. 6
19%
D. 0
ID:121
print("apple is a fruit"[7:10])
ID:121 - What will be the output of the following?
Anonymous Quiz
1%
a. Apple
60%
b. s a
12%
c. Fruit
26%
d. None of the above
ID:122 - What will be the output of the following?
Anonymous Quiz
44%
a) (1, 2, 3, 4)
4%
b) (1, 2, 3)
10%
c) (4, 1, 2, 3)
41%
d) (1, 2, 3, (4,))
👍1
👍1
Q1. What is OOP?
Anonymous Quiz
3%
Out-of-Order Processing
92%
Object-Oriented Programming
2%
Out-of-Place Programming
3%
Optimized Object Parsing
Q2. What is an object in OOP?
Anonymous Quiz
11%
A variable
7%
A block of code
74%
An instance of a class
9%
A built-in function
Q3. Which of the following is NOT a basic principle of OOP?
Anonymous Quiz
5%
Encapsulation
7%
Inheritance
7%
Polymorphism
80%
Concatenation
Q4. What is inheritance in OOP?
Anonymous Quiz
79%
The ability to create new classes from existing ones
13%
The ability to access private members of a class
0%
The ability to create objects
9%
The ability to override methods
Q5. Which keyword is used to inherit a class in Python?
Anonymous Quiz
35%
extends
20%
inherit
17%
superclass
28%
class
👍2👎2
Q6. What is encapsulation in OOP?
Anonymous Quiz
79%
Hiding the implementation details of an object
5%
Making an object public
16%
Exposing private data of an object
0%
Limiting the number of objects
Q7. Which access specifier in Python indicates that an attribute should not be accessed directly from outside the class?
Anonymous Quiz
11%
public
77%
private
9%
protected
4%
hidden
Q9. Which OOP principle allows methods in a subclass to have the same name as methods in its superclass, but with different implementations?
Anonymous Quiz
13%
Inheritance
60%
Polymorphism
18%
Encapsulation
9%
Abstraction
Q10. What is the process of defining a new class based on an existing class called?
Anonymous Quiz
5%
Polymorphism
71%
Inheritance
16%
Abstraction
7%
Encapsulation
Q11. What is a superclass in inheritance?
Anonymous Quiz
39%
A class that does not have any parent class
37%
A class from which other classes inherit
20%
A class that can inherit from multiple classes
3%
A class with private attributes only
Q12. What is a subclass in inheritance?
Anonymous Quiz
32%
A class that does not have any child class
39%
A class that has a parent class
3%
A class that cannot have private attributes
25%
A class that can inherit from multiple classes
👎4👍1