Conditional Statements and Loops Quiz - CBSE Class 10 Computer Science
Free practice quiz: Conditional Statements and Loops (CBSE Class 10 Computer Science). 18 multiple-choice questions with answers and explanations. Play online, no sign-up needed.
This CBSE Class 10 Computer Science practice quiz has 18 multiple-choice questions on Conditional Statements and Loops, and 18 of them come with an explanation. Try the 5 sample questions below (tap an option to check yourself), then play the full quiz online. No sign-up needed.
Start quiz: 18 questions, freeSample questions
What is a conditional statement in programming?
Show answer
Answer: A. A statement that performs different actions based on a condition
Conditional statements decide the flow of control depending on a condition being true or false.
Which loop is known as a definite loop in Python?
Show answer
Answer: A. for loop
A for loop is used for iterating over a sequence (like a list, tuple, or string), where the number of iterations is definite.
Which statement will terminate a while loop or for loop prematurely?
Show answer
Answer: C. break
The 'break' statement in Python is used to end the loop prematurely, moving control to the next statement following the loop.
Which of the following can act as a loop control statement in Python?
Show answer
Answer: A. break
In Python, 'break' is the only valid loop control statement that can alter the flow of a loop by terminating it.
When is else statement not executed in loops?
Show answer
Answer: C. Whenever the break statement is encountered
When a break statement is executed, the control exits the loop, and the else clause will not be executed.
More questions in this quiz
Answers and explanations are in the full quiz.
- Which of the following is a keyword for a conditional statement in Python?
- What is the output of the code: if 5 > 3: print('Hello World')
- Which keyword is used to skip the current iteration of a loop?
- What does the 'else' clause in a loop execute?
- What is the purpose of the 'pass' statement in Python loops?
- Which of these is a correct syntax for an if-elif-else statement in Python?
- How many times is 'Hello' printed if the loop runs as: for i in range(4, 0, -1): print('Hello')?
- What does 'while True:' represent in Python?
- In a nested loop, ‘continue’ applies to which loop by default?
- How is a while loop different from a for loop?
- What does 'range(5, 10, 2)' generate?
- What will be the result of the nested loop: for i in range(1, 3): for j in range(1, 3): print(i + j) break
- Which loop construct is preferred for dynamic conditions that change during iterations?
More quizzes
Browse all Programming with Python quizzes