ExamVeda
Login
Home
21
What is the purpose of the continue statement in loops?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
22
What is the output of the following code snippet:
for i in range(3, 0, -1):
    print(i)
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
23
In Python, which loop is commonly used when you have a specific condition to break the loop?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
24
What will the following code print:
x = 5
while x > 0:
    print(x)
    x -= 1
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
25
What is the output of the following code:
x = 0
while x < 5:
    print(x)
    x += 1
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
26
What is the purpose of the pass statement in a loop?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
27
In Python, which loop is suitable for cases where you need to execute a block of code multiple times until a condition is met?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
28
What is the output of the following code snippet:
for i in range(1, 5, 2):
    print(i)
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
29
What will the following loop print:
for i in range(3):
    print(i)
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
30
What is the output of the following code snippet:
count = 0
while count < 3:
    print("Hello")
    count += 1
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board