Practice MCQs for Class 12 Computer Science For Loop in Python
Review structured MCQ sets for Class 12 Computer Science For Loop in Python. Built according to official CBSE guidelines, these downloadable questions support daily revision and core concept reinforcement.
Access For Loop in Python Questions and Solutions
View or download the dedicated For Loop in Python MCQ resource below. Practicing these 50 objective questions regularly builds familiarity with standard exam patterns and helps secure higher marks in final Computer Science evaluations.
Question. The for loop in Python is an _____________
a) Entry Controlled Loop
b) Exit Controlled Loop
c) Both of the above
d) None of the above
Answer : A
Question. Which of the following loop is not supported by the python programming language?
a) for loop
b) while loop
c) do…while loop
d) None of the above
Answer : C
Question. Which of the following is True regarding loops in Python?
a) Loops should be ended with keyword “end”.
b) No loop can be used to iterate through the elements of strings.
c) continue is used to continue with the remaining statements inside the loop.
d) break can be used to bring control out of the current loop.
Answer : D
Question. I wants to continuously check for a correct answer each time user enters a value, what loop would I use?
a) for loop
b) while loop
Answer : B
Question. Why is iteration important?
a) It determines the order in which instructions are carried out
b) It allows multiple paths through a program
c) It allows code to be simplified by removing repeated steps
d) It ensures the code works correctly
Answer : C
Question. Write the output of the following Python code:
for i in range(2,7,2):
print(i * ‘$’)
a) 2$
4$
6$
b) $$
$$$$
$$$$$$
c) 2$4$6$
d) None of the above
Answer : B
Question. Find the output of the following program segments:
country = ‘INDIA’
for i in country:
print (i, end=”)
a) INDIAN
b) INDIA
c) INDI
d) INDIAS
Answer : B
Question. How many times the message Hello will appear when this loop runs?
while(0):
print(‘Hello’)
a) Not at all
b) Only once
c) Two times
d) Infinite times
Answer : A
Question. Which of the following is not true for the for statement in Python?
a) The statements within the body of for loop are executed till the range of values is exhausted
b) for loop iterates over the range or sequence.
c) for loop cannot be nested.
d) break statement is used to terminate a for loop without completing its iteration.
Answer : C
Question. range(3) in Python is equivalent to:
a) range(0,3,1)
b) range(1,4,1)
c) range(1,3)
d) range(1,3,0)
Answer : A
Question. What is the result of executing the following code?
count = 10
while count <= 10:
if count < 10:
count = count + 1
print(count)
a) The program will loop indefinitely
b) The value of number will be printed exactly 1 time
c) The while loop will never get executed
d) The value of number will be printed exactly 5 times
Answer : A
Question. A loop block in python starts with a –
a) ; (semicolon)
b) , (comma)
c) : (colon)
d) # (hash)
Answer : C
Question. Which of the following is False regarding loops in Python?
a) Loops are used to perform certain tasks repeatedly.
b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.
c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.
d) for loop can be used to iterate through the elements of lists.
Answer : C
Question. What is another word for ‘iteration’ ?
a) Selection
b) Assignment
c) Sequencing
d) Repetition
Answer : D
Question. To access a list which contains ten elements, which of the following uses of range() would produce a list of the desired indexes?
a) range(1,10)
b) range(0,9)
c) range(10)
d) range(1,11)
Answer : C
Question. Find and write the output of the following python code:
x = “abcdef”
i = “a”
while i in x:
print(i, end = ” “)
a) a
b) a a a a a a
c) a a a a a a … infinite times
d) Code will generate error
Answer : C
Question. Find the output of the following program segments:
i = 0
sum = 0
while i < 9:
if i % 4 == 0:
sum = sum + i
i = i + 2
print (sum)
a) Infinite Loop
b) 12
c) 14
d) 10
Answer : B
Question. Does Python support Exit – Controlled Loop?
a) Yes
b) No
Answer : B
Question. What will be the output of the given program segment?
for I in range(10, 1, 1):
print(I)
print(I)
a) 10
b) 9
c) Error
d) None of the above
Answer : B
Question. Which of the following is not a valid keyword of Python associated with loops?
a) continue
b) check
c) range
d) break
Answer : B
Question. When does the else statement written after loop executes?
a) When loop condition becomes false
b) When break statement is executed in the loop
c) else statement is always executed
d) None of the above
Answer : A
Question. Which term describes a loop that continues repeating without a terminating (ending) condition?
a) Infinite Loop
b) Conditional Loop
c) Unlimited Loop
d) Sequence Loop
Answer : A
Question. A count controlled loop will :
a) Repeat code until a condition is met
b) Repeat code a specific amount of times
c) Repeat code a random amount of times
d) None of the above
Answer : B
Question. Find the output of the following program segments:
a = 110
while a > 100:
print(a, end=’#’)
a –= 2
a) 110#108#106#104#102#100#
b) 110#108#106#104#102#
c) 110#108#106#104#102#
d) None of the above
Answer : B
Question. Which of the following is consider as an infinite loop?
a) while(infinte):
b) while(1):
c) while(not 1):
d) while(!1)
Answer : B
Question. Which of the following call to range() in Python will not yield anything?
a) range(-5, -1)
b) range(-1, -5, -1)
c) range(-5)
d) All of the above
Answer : C
Question. Which is not correct for the repetition constructs in Python?
a) For a for loop, an equivalent while loop can always be written.
b) For a while loop, an equivalent for loop can be written.
c) continue cannot be used with for loops.
d) else can be used with for and while both.
Answer : C
Question. Select which is true for, for loop
a) Python’s for loop used to iterates over the items of list, tuple, dictionary, set, or string
b) else clause of for loop is executed when the loop terminates naturally
c) else clause of for loop is executed when the loop terminates abruptly
d) We use for loop when we want to perform a task indefinitely until a particular condition is met
Answer : A
Question. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?
a) while Choice == Answer:
Choice = input()
b) while Choice != Answer:
Choice = input()
c) while Answer != Choice:
Choice = input()
d) while Answer =! Choice:
Choice = input()
Answer : B
Question. How would you create a loop to iterate over the contents of the list given as?
monthDays = [31,28,31,30,31,30,31,31,30,31,30,31]
and print out each element?
a) for days in range(monthDays):
print(days)
b) for days in monthDays:
print(days)
c) for days in range(len(monthDays)):
print(days)
d) for days in monthDays[0]:
print(days)
Answer : B
Question. How many times will this loop run?
while(1):
print(2)
a) 1 time
b) 2 times
c) 3 times
d) None of the above
Answer : D
Question. What will be the final value of I after execution of the loop:
for I in range(10):
print(I)
a) 10
b) 9
c) None
d) Error
Answer : B
Question. break in Python is used ______________
a) To restart a loop
b) Terminate a loop
c) To jump in between the loop
d) None of the above
Answer : B
Question. ________ in Python is a counter-controlled loop.
a) for
b) while
c) Both (a) and (b)
d) None of the above
Answer : A
Question. Code repeated / looped until a condition has been met or a set number of times.
a) Sequence
b) Iteration
c) Selection
d) Variable
Answer : B
Question. Find the output of the following program segments:
for i in range(20,30,2):
print(i)
a) 20 22 24 26 28
b) 20
22
24
26
28
c) 20 22 24 26 28 30
d) 20
22
24
26
28
30
Answer : B
Question. Iteration stands for ___________
a) The order in which instructions are carried out
b) A decision point in a program
c) The repetition of steps within a program
d) Testing a program to make sure it works
Answer : C
Question. How many times will this loop run?
while(1==2):
pass
a) 0
b) 1
c) 3
d) Infinite
Answer : D
Question. Which of the following is not a valid jump statement in Python?
a) break
b) goto
c) call
d) continue
Answer : C
Attempt Mock Tests on this topic
Free study material for Computer Science
For Loop in Python Objective Questions & Solutions for Class 12 Computer Science
Download Multiple Choice Questions: For Loop in Python (Class 12 Computer Science)
Explore reliable practice questions for For Loop in Python tailored for Class 12 Computer Science learners. Use these multiple-choice formats to evaluate preparedness and strengthen problem-solving skills.
Concept Clarification for For Loop in Python
Cross-reference your completed choices with comprehensive NCERT solutions for Class 12 Computer Science to ensure absolute clarity across all sub-topics in this chapter.
Additional Study Resources for Class 12 Computer Science
Explore our broader library of printable assignments, chapter notes, and mock tests designed to support continuous revision and secure higher marks in CBSE assessments.
FAQs
You can get most exhaustive CBSE Class 12 Computer Science For Loop in Python MCQs for free on StudiesToday.com. These MCQs for Class 12 Computer Science are updated for the 2026-27 academic session as per CBSE examination standards.
Yes, our CBSE Class 12 Computer Science For Loop in Python MCQs include the latest type of questions, such as Assertion-Reasoning and Case-based MCQs. 50% of the CBSE paper is now competency-based.
By solving our CBSE Class 12 Computer Science For Loop in Python MCQs, Class 12 students can improve their accuracy and speed which is important as objective questions provide a chance to secure 100% marks in the Computer Science.
Yes, Computer Science MCQs for Class 12 have answer key and brief explanations to help students understand logic behind the correct option as its important for 2026 competency-focused CBSE exams.
Yes, you can also access online interactive tests for CBSE Class 12 Computer Science For Loop in Python MCQs on StudiesToday.com as they provide instant answers and score to help you track your progress in Computer Science.