MCQ on Python Control Flow Statements For Class 11 Students

MCQ on Python Control Flow Statements For Class 11 Students. We covered all the MCQ on Python Control Flow Statements For Class 11 Students in this post for free so that you can practice well for the exam.

Install our MCQTUBE Android app from the Google Play Store and prepare for any competitive government exams for free.



We created all the competitive exam MCQs into several small posts on our website for your convenience.

You will get their respective links in the related posts section provided below.

Join Telegram Group and Get FREE Alerts! Join Now

Join WhatsApp Group For FREE Alerts! Join Now

Related Posts:

Questions hide

MCQ on Python Control Flow Statements For Class 11 Students

Which of these is the correct way to write an if condition in Python?

a. if a>=2:

b. if (a >=2)

c. if (a => 22)

d. if a >= 22

Option a – if a>=2:

What keyword should you use in Python to introduce another condition after if?

a. else if

b. elseif

c. elif

d. None of the above

Option c – elif

Is it possible to combine if and else into a single line in Python?

a. Yes

b. No

c. Python doesn’t use if/else

d. None of the above

Option a – Yes

What is the role of control structures in a Python program?

a. To create custom data structures

b. To determine the flow of execution in the code

c. To manage pre-start and post-end actions

d. None of the above

Option b – To determine the flow of execution in the code

What will the following Python expression return: 'p' + 'q' if '12'.isdigit() else 'r' + 's'?

a. pq

b. rs

c. pqrs

d. pq12

Option a – pq

Which option correctly checks whether the variable a is equal to b?

a. if a = b:

b. if a== b:

c. if a ==C:

d. if a ==b

Option b – if a== b:

Is the switch-case statement available in Python?

a. True

b. False

c. Switch exists but isn’t usable in Python

d. None of the above

Option b – False

Which one of the following for loops is valid in Python?

a. for(i=0; i< n; i++)

b. for i in range(0,5):

c. for i in range(0,5)

d. for i in range(5)

Option b – for i in range(0,5):

What result will range(5, 0, -2) produce in Python?

a. 543210-1

b. 5 432 10

c. 5 3 1

d. None of the above

Option c – 5 3 1

A while loop in Python is most suitable for which type of repetition?

a. indefinite

b. discriminant

c. definite

d. indeterminate

Option a – indefinite

When does the else block after a loop execute in Python?

a. When a break is encountered in the loop

b. When the loop ends normally without break

c. The else part always runs

d. None of the above

Option b – When the loop ends normally without break

What keyword would you use to add an alternative condition to an if statement?

a. else if

b. elif

c. elseif

d. None of the above

Option b – elif

What is the role of control structures in a Python program?

a. They are used to create custom data types

b. They manage how and when different parts of the code are executed

c. They handle actions before the program runs and after it stops

d. They serve no specific purpose

Option b – They manage how and when different parts of the code are executed

Is there a switch-case feature available in Python?

a. Yes

b. No

c. Python includes it, but it’s not usable

d. Not applicable

Option b – No

What is the result of this expression: 'p' + 'q' if '12'.isdigit() else 'r' + 's'?

a. pq

b. rs

c. pqrs

d. pq12

Option b – rs

Which of the following correctly checks if a and b have the same value?

a. if a == b:

b. if a = b:

c. if a === C:

d. if a ==b

Option a – if a == b:

To evaluate more than one condition in Python, which structure should be used?

a. if

b. if…elif

c. switch

d. None of these

Option b – if…elif

In Python, if a condition evaluates to true, which block of code runs, and what happens if it doesn’t?

a. false, true

b. true, else

c. both conditions execute

d. Can’t be determined

Option b – true, else

Mala is designing a program that displays funny messages when a user inputs a number. Which decision-making structure would be the most appropriate?

a. if

b. if else

c. if elif

d. Nested if else

Option b – if else

Identify the option that is not considered a valid control structure in Python:

a. if statement

b. else clause

c. elif clause

d. for loop

e. while loop

f. Generator expression

Option f – Generator expression

Which of these options is not a proper method to exit a nested loop?

a. break

b. breakouter_loop

c. breakinner_loop

d. break()

Option d – break()

Select the choice that is not a recognized way to skip to the next iteration inside a nested loop:

a. continue

b. continueouter_loop

c. continueinner_loop

d. continue()

Option d – continue()

Which of the following is not a valid approach to stop a while loop before it finishes naturally?

a. break

b. return

c. raise Exception

d. None of these

Option d – None of these

Choose the option that does not correctly demonstrate looping through a list:

a. for i in range(len(my_list)):

b. for i in my_list:

Join Telegram Group and Get FREE Alerts! Join Now

Join WhatsApp Group For FREE Alerts! Join Now

c. for i in enumerate(my_list):

d. for i in zip(my_list, another_list):

Option a – for i in range(len(my_list)):

Which statement does not represent a valid technique to sort a list in Python?

a. my_list.sort()

b. my_list.sort(reverse=True)

c. my_list.sort(key=lambda x: x[1])

d. sorted(my_list)

Option d – sorted(my_list)

Find the method that is not a valid way to reverse the elements of a list:

a. my_list.reverse()

b. my_list = my_list[:-1]

c. my_list = sorted(my_list, reverse=True)

d. None of these

Option c – my_list = sorted(my_list, reverse=True)

Which of these is not a correct approach to check if a specific value exists in a list?

a. my_list.count(value) > 0

b. value in my_list

c. my_list.index(value) >= 0

d. None of these

Option c – my_list.index(value) >= 0

What is the most performance-friendly method to loop through a large list?

a. for i in range(len(my_list)):

b. for element in my_list:

c. for i, element in enumerate(my_list):

d. for element in my_list[:-1]:

Option b – for element in my_list:

Which of these is an invalid method to exit from nested loops?

a. break

b. breakouter_loop

c. breakinner_loop

d. break()

Option d – break()

Which option is not a correct way to move to the next iteration inside nested loops?

a. continue

b. continueouter_loop

c. continueinner_loop

d. continue()

Option d – continue()

Which method below can’t be used to stop a while loop early?

a. break

b. return

c. raise Exception

d. All of the above are valid

Option d – All of the above are valid

How can you not correctly verify whether an item exists in a list?

a. my_list.count(value) > 0

b. value in my_list

c. my_list.index(value) >= 0

d. All of the above are correct

Option c – my_list.index(value) >= 0

Choose the option that isn’t a valid way to add an item to a list.

a. my_list.append(value)

b. my_list += [value]

c. my_list.insert(len(my_list), value)

d. None of the above

Option d – None of the above

Which of the following won’t correctly remove an element from a list?

a. my_list.remove(value)

b. del my_list[my_list.index(value)]

c. my_list.pop(my_list.index(value))

d. None of the above

Option d – None of the above

Select the option that doesn’t accurately combine two lists into one.

a. new_list = my_list1 + my_list2

b. new_list = list(my_list1) + list(my_list2)

c. new_list = copy.deepcopy(my_list1) + copy.deepcopy(my_list2)

d. None of the above

Option d – None of the above

Which technique does not reliably confirm that a list is empty?

a. not my_list

b. len(my_list) == 0

c. my_list is None

Option a – not my_list

Identify the conditional sentence below.

a. I went shopping yesterday.

b. If I have cash, I’ll purchase some milk.

c. The ocean is blue.

d. I enjoy cold desserts.

Option b – If I have cash, I’ll purchase some milk

Which of these demonstrates a correct use of the in keyword?

a. if value in list:

b. if value not in list:

c. if value is in list:

d. All of these

Option d – All of these

In which scenario is the is keyword used appropriately?

a. if value is None:

b. if value is not None:

c. if value is True:

d. All of these

Option d – All of these

What is the proper way to write a conditional expression (ternary operator) in Python?

a. x = condition ? value1 : value2

b. x = if condition: value1 else: value2

c. x = if condition: value1: value2

d. None of these

Option a – x = condition ? value1 : value2

Which among the following is a correct form of a lambda function?

a. lambda x: x + 1

b. lambda x, y: x + y

c. lambda: x + 1

d. All of these

Option d – All of these

Which of the following represents the correct structure for an if statement?

a. if (condition) { statement; }

b. if (condition) { statement; } else { statement; }

c. if (condition) statement1; elseif (condition) { statement2; } else { statement3; }

d. All of the above

Option d – All of the above

What does the else statement do?

a. Executes a block of code if the condition in the if statement is false

b. Executes a block of code if the condition in the if statement is true

c. Executes a block of code when the condition in the if statement is not satisfied

d. None of the above

Option a – Executes a block of code if the condition in the if statement is false

What is the role of the elseif statement?

a. Executes a block of code if the if condition is false and the elseif condition is true

b. Executes a block of code if the if condition is true and the elseif condition is false

c. Executes a block of code if the if condition is not met and the elseif condition is true

d. None of the above

Option a – Executes a block of code if the if condition is false and the elseif condition is true

What are the advantages of using nested loops?

a. They improve code readability and performance

b. They allow repeated execution of a block of code within another loop

c. They ensure that a task is repeated until a specific condition is fulfilled within a loop

d. All of the above

Option d – All of the above

What are the limitations of using nested loops?

a. They can decrease code readability and performance

b. They repeatedly execute a block of code within another loop

c. They can make code execution dependent on conditions within nested loops

d. All of the above

Option a – They can decrease code readability and performance

In which scenarios might nested loops be useful?

a. To traverse through a multidimensional array

b. For performing binary search algorithms

c. To generate a Fibonacci sequence

d. All of the above

Option d – All of the above

Is it possible to use a break statement in a switch case?

a. Yes

b. No

Option a – Yes

What is the main function of a break statement in a switch case?

a. It stops the execution of the switch case block

b. It skips directly to the next case

c. It executes the default case block

d. None of the above

Option a – It stops the execution of the switch case block

Can a continue statement be used within a switch case?

a. Yes

b. No

Option b – No

What is the purpose of using a continue statement within a switch case?

a. It terminates the switch case block

b. It skips to the next case statement

c. It executes the default case statement

d. None of the above

Option d – None of the above

How does a break statement differ from a continue statement?

a. A break statement exits a loop or switch block, whereas a continue statement moves to the next iteration of a loop

b. A break statement moves to the next loop iteration, while a continue statement exits the loop or switch block

c. There is no distinction between break and continue statements

d. None of the above

Option a – A break statement exits a loop or switch block, whereas a continue statement moves to the next iteration of a loop

How do for, while, and do-while loops differ from each other?

a. A for loop is for known iterations, a while loop for unknown iterations, and a do-while loop ensures at least one execution of the loop body

b. A for loop is for unknown iterations, a while loop for known iterations, and a do-while loop ensures at least one execution

c. There is no difference between a for loop, a while loop, and a do-while loop

d. None of the above

Option a – A for loop is for known iterations, a while loop for unknown iterations, and a do-while loop ensures at least one execution of the loop body

What are some typical errors made when using control flow statements?

a. Failing to use break statements to exit loops or switch cases

b. Not utilizing continue statements to skip to the next loop iteration

c. Choosing the wrong control flow statement for a specific task

d. All of the above

Option d – All of the above

How can common errors in control flow statements be avoided?

a. By carefully planning the logic of the code before choosing the control flow structure

b. By using break and continue statements appropriately

c. By thoroughly testing the code to ensure proper functionality

d. All of the above

Option d – All of the above

What is the primary function of the switch statement?

a. To compare a variable with a set of values

b. To execute specific code based on the value of a variable

c. To create an interactive menu

d. All of the above

Option d – All of the above

How does a case statement differ from a default statement?

a. A case statement checks if a variable matches a specific value, while the default statement checks if the variable does not match any of the case values

b. A case statement runs code when a variable matches a specific value, while the default statement runs code when the variable doesn’t match any case values

c. Both a and b are correct

d. None of the above

Option c – Both a and b are correct

Is it required to include a break statement after each case in a switch?

a. Yes, every case must end with a break statement

b. No, a break statement isn’t mandatory after every case

c. A break statement is needed only after the last case

d. A break statement is necessary only before the default case

Option a – Yes, every case must end with a break statement

Can the switch statement be applied to variables of all types?

a. Yes, it can be used to check variables of any type

b. No, it only works with variables of integer types

c. No, it’s only valid for character-type variables

d. No, it only supports string-type variables

Option b – No, it only works with variables of integer types

We covered all the MCQ on Python Control Flow Statements For Class 11 Students above in this post for free so that you can practice well for the exam.

Check out the latest MCQ content by visiting our mcqtube website homepage.

Also, check out:

Join Telegram Group and Get FREE Alerts! Join Now

Join WhatsApp Group For FREE Alerts! Join Now

Hello, I am the admin of mcqtube.com website. I am a blogger and app developer. Thanks.

Leave a Comment

Floating ChatBot
Ask

Doubt?, Ask me Anything



Sticky Bottom Popup