ID:117 - What will be the output of the following?
Anonymous Quiz
0%
a) 26
88%
b) 125
8%
c) 525
5%
d) None of above
ID:118
i = 1:
while True:
if i%3 == 0:
break
print(i)
علم البيانات | DS2 Quizes
ID:118 i = 1: while True: if i%3 == 0: break print(i)
ID:118 - What will be the output of the following?
Anonymous Quiz
13%
A) 1 2 3
16%
B)1 2
45%
C)infinite loop
26%
D) syntax Error
ID:119
d = {0, 1, 2}
for x in d:
print(x)
ID:119 - What will be the output of the following?
Anonymous Quiz
15%
A. {0, 1, 2} {0, 1, 2} {0, 1, 2}
65%
B. 0 1 2
18%
C. Syntax_Error
3%
D. None of these above
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