Any2Quiz
CBSE / 10 / Computer Science / Programming with Python

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.

Play all 18 questions free

Sample questions

  1. What is a conditional statement in programming?

    1. A statement that performs different actions based on a condition
    2. A statement that repeats actions
    3. A statement that defines variables
    4. A statement for input/output
    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.

  2. Which loop is known as a definite loop in Python?

    1. for loop
    2. if loop
    3. while loop
    4. do-while loop
    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.

  3. Which statement will terminate a while loop or for loop prematurely?

    1. stop
    2. pass
    3. break
    4. exit
    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.

  4. Which of the following can act as a loop control statement in Python?

    1. break
    2. return
    3. pass
    4. None of the above
    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.

  5. When is else statement not executed in loops?

    1. When the loop completes normally
    2. Whenever the continue statement is encountered
    3. Whenever the break statement is encountered
    4. After return is called
    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.

Take the full quiz

More quizzes

Browse all Programming with Python quizzes