Computational Thinking and Programming-I Quiz 7

๐Ÿ”€ Computational Thinking & Programming-I Quiz 7 โ€” Flow of Control (Class 11 CS)

Practice 20 CBSE Class 11 Computer Science (Code 083) MCQs on the flow of control โ€” indentation, sequential flow, conditional flow (if/elif/else), iterative flow (for/while loops), loop control keywords (break, continue, pass), range(), and nested structures.

Every code behaviour below has been verified by actually running it in Python. Tap any question to reveal the answer with a clear explanation.

๐Ÿ”€ Flow of Controlโ‡ฅ Indentationโžก๏ธ Sequential Flowโ“ Conditional Flow๐Ÿ” Iterative Flow๐Ÿ›‘ Loop Control
Q1
๐Ÿ”€ Flow of Control

What does flow of control refer to in programming?

  1. The order in which statements are written in the program
  2. The direction in which data flows through the program
  3. The decision-making process in the program
  4. The flow of execution through the program
Show Answer & Explanation

โœ… Answer: (d) The flow of execution through the program

Flow of control refers to the order in which statements are actually executed โ€” which can differ from how they’re written on the page, once conditions, loops, and function calls come into play.

Q2
โ‡ฅ Indentation

What is the purpose of indentation in Python?

  1. To make the code look neat and organized
  2. To indicate the start and end of a block of code
  3. To define the structure of the program
  4. To improve the performance of the program
Show Answer & Explanation

โœ… Answer: (b) To indicate the start and end of a block of code

In Python, indentation isn’t just a style choice โ€” it’s syntactically required to mark where a block of code starts and ends (inside an if, for, while, or function). Most other languages use braces { } for this instead.

Q3
โžก๏ธ Sequential Flow

What is sequential flow of control?

  1. Execution of statements in a specific order from top to bottom
  2. Execution of statements based on a condition
  3. Repetitive execution of statements until a condition is met
  4. Execution of statements in a random order
Show Answer & Explanation

โœ… Answer: (a) Execution of statements in a specific order from top to bottom

Sequential flow is the simplest and default flow โ€” statements run one after another, top to bottom, in exactly the order they’re written, with no branching or repetition.

Q4
โ“ Conditional Flow

Which control structure is used for making decisions in programming?

  1. Looping
  2. Indentation
  3. Conditional statements
  4. Function calls
Show Answer & Explanation

โœ… Answer: (c) Conditional statements

Conditional statements (if, elif, else) are what let a program branch and make decisions โ€” running different code depending on whether a condition is true or false.

Q5
โ“ Conditional Flow

What is the purpose of conditional statements?

  1. To repeat a block of code multiple times
  2. To control the flow of execution based on a condition
  3. To improve the readability of the code
  4. To define the structure of a function
Show Answer & Explanation

โœ… Answer: (b) To control the flow of execution based on a condition

Conditional statements exist to control which code runs based on whether a condition evaluates to True or False โ€” letting the program react differently to different situations.

Q6
โ“ Conditional Flow

Which of the following is a conditional statement in Python?

  1. for loop
  2. while loop
  3. if statement
  4. break statement
Show Answer & Explanation

โœ… Answer: (c) if statement

The if statement is Python’s core conditional construct. for and while are looping constructs, and break is a loop-control keyword โ€” neither makes a decision on its own.

Q7
๐Ÿ” Iterative Flow

What is iterative flow of control?

  1. Execution of statements in a specific order from top to bottom
  2. Execution of statements based on a condition
  3. Repetitive execution of statements until a condition is met
  4. Execution of statements in a random order
Show Answer & Explanation

โœ… Answer: (c) Repetitive execution of statements until a condition is met

Iterative flow means a block of code runs repeatedly โ€” either a fixed number of times or until some condition is no longer true โ€” which is exactly what loops are built for.

Q8
๐Ÿ” Iterative Flow

Which control structure is used for repetitive execution of code in programming?

  1. Looping
  2. Indentation
  3. Conditional statements
  4. Function calls
Show Answer & Explanation

โœ… Answer: (a) Looping

Looping (using for or while) is the control structure specifically designed to repeat a block of code multiple times.

Q9
๐Ÿ” Iterative Flow

What is the purpose of loops in programming?

  1. To make the code look neat and organized
  2. To indicate the start and end of a block of code
  3. To define the structure of the program
  4. To repeat a block of code multiple times
Show Answer & Explanation

โœ… Answer: (d) To repeat a block of code multiple times

Loops exist purely to repeat a block of code multiple times โ€” avoiding the need to manually rewrite the same statements over and over.

Q10
๐Ÿ” Iterative Flow

Which of the following is an iterative control structure in Python?

  1. if statement
  2. for loop
  3. break statement
  4. function call
Show Answer & Explanation

โœ… Answer: (b) for loop

The for loop is one of Python’s two core iterative structures (the other being while) โ€” it repeats a block of code once for each item in a sequence.

Q11
โ“ Conditional Flow

Which keyword is used to test additional conditions after an initial if, without writing a separate nested if?

  1. else
  2. elif
  3. and
  4. break
Show Answer & Explanation

โœ… Answer: (b) elif

elif (short for โ€œelse ifโ€) lets you chain multiple condition checks in a single, flat if-elif-else structure, instead of nesting a new if inside every else.

Q12
๐Ÿ” Iterative Flow

Which loop is typically used when the number of iterations is known in advance?

  1. while loop
  2. for loop
  3. if-else statement
  4. try-except block
Show Answer & Explanation

โœ… Answer: (b) for loop

A for loop is the natural choice when you already know how many times to repeat โ€” e.g. iterating over a list or a fixed range().

Q13
๐Ÿ” Iterative Flow

Which loop is typically used when the number of iterations depends on a condition and isn’t known in advance?

  1. for loop
  2. while loop
  3. if-else statement
  4. function call
Show Answer & Explanation

โœ… Answer: (b) while loop

A while loop keeps running as long as its condition stays true โ€” perfect for situations where you don’t know upfront exactly how many repetitions will be needed.

Q14
๐Ÿ›‘ Loop Control

Which keyword immediately terminates a loop before it has finished all its iterations?

  1. continue
  2. pass
  3. break
  4. return
Show Answer & Explanation

โœ… Answer: (c) break

break exits the loop immediately, skipping any remaining iterations entirely, and execution continues with the code right after the loop.

Q15
๐Ÿ›‘ Loop Control

Which keyword skips the rest of the current iteration and moves on to the next one?

  1. break
  2. continue
  3. pass
  4. exit
Show Answer & Explanation

โœ… Answer: (b) continue

continue stops the current pass through the loop body right where it is, and jumps straight to the next iteration โ€” the loop itself keeps running.

Q16
๐Ÿ›‘ Loop Control

Which keyword acts as a null operation โ€” a placeholder used when Python’s syntax requires a statement but you want no action to happen?

  1. break
  2. continue
  3. pass
  4. none
Show Answer & Explanation

โœ… Answer: (c) pass

pass does absolutely nothing โ€” it’s used as a placeholder inside an empty if, loop, or function body so the code remains syntactically valid while you fill in the logic later.

Q17
๐Ÿ” Iterative Flow

What does range(5) generate in Python?

  1. Numbers from 1 to 5
  2. Numbers from 0 to 4
  3. Numbers from 0 to 5
  4. Numbers from 1 to 4
Show Answer & Explanation

โœ… Answer: (b) Numbers from 0 to 4

range(5) generates 5 numbers starting from 0, up to (but not including) 5: 0, 1, 2, 3, 4.

Q18
โ‡ฅ Indentation

What happens if the indentation is inconsistent within the same block of code in Python?

  1. Python ignores it and runs the code normally
  2. It raises an IndentationError
  3. It automatically fixes the indentation
  4. It only causes a warning, not an error
Show Answer & Explanation

โœ… Answer: (b) It raises an IndentationError

Since Python relies on indentation to define blocks, mixing inconsistent spacing within the same block raises an IndentationError and stops the program from running.

Q19
๐Ÿ” Iterative Flow

In Python, can a for loop or while loop have an else block, and what does it do?

  1. No, loops cannot have an else block
  2. Yes, and it always runs after every loop, no matter what
  3. Yes, and it runs only if the loop completes without hitting a break
  4. Yes, but it only works with while loops, not for loops
Show Answer & Explanation

โœ… Answer: (c) Yes, and it runs only if the loop completes without hitting a break

Python uniquely allows an else block after a loop โ€” it runs only if the loop finishes naturally without being stopped early by a break. If a break does occur, the else block is skipped entirely.

Q20
โ“ Conditional Flow

What is a nested conditional or nested loop?

  1. Two independent loops running one after another
  2. A conditional statement or loop placed inside another conditional statement or loop
  3. A loop that runs only once
  4. An error that occurs when loops are used incorrectly
Show Answer & Explanation

โœ… Answer: (b) A conditional statement or loop placed inside another conditional statement or loop

Nesting means placing one control structure inside another โ€” like an if inside a for loop, or a loop inside another loop โ€” to handle more complex, layered logic.

Jitendra Singh
โœ” Verified Educator

Jitendra Singh

Founder of CBSEPython.in

I help CBSE Class 9โ€“12 students learn Python, Information Technology, Artificial Intelligence and Computer Science through easy notes, quizzes, MCQs and sample papers.

Read More About Me โ†’