Any2Quiz
Quizzes / CBSE / Class 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.

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, free

Sample questions

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

Take the full quiz

More questions in this quiz

Answers and explanations are in the full quiz.

  1. Which of the following is a keyword for a conditional statement in Python?
  2. What is the output of the code: if 5 > 3: print('Hello World')
  3. Which keyword is used to skip the current iteration of a loop?
  4. What does the 'else' clause in a loop execute?
  5. What is the purpose of the 'pass' statement in Python loops?
  6. Which of these is a correct syntax for an if-elif-else statement in Python?
  7. How many times is 'Hello' printed if the loop runs as: for i in range(4, 0, -1): print('Hello')?
  8. What does 'while True:' represent in Python?
  9. In a nested loop, ‘continue’ applies to which loop by default?
  10. How is a while loop different from a for loop?
  11. What does 'range(5, 10, 2)' generate?
  12. 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
  13. Which loop construct is preferred for dynamic conditions that change during iterations?

More quizzes

Browse all Programming with Python quizzes

More to play

Daily ChallengeA new quiz every day. Keep your streak.HangmanGuess the word, letter by letter.Story QuestLearn through short interactive stories.All quizzesCBSE, ICSE, competitive exams and more.