Question Detail

COS 102 6 lecture note; fundamentals of programming Objective Question

Question

What is the primary characteristic of a while loop in Python?
Options
A It iterates a fixed number of times over a sequence.
B It allows general repetition based on the repeated testing of a Boolean condition.
Correct Answer
C It is used for defining functions.
D It only executes once.
Correct Answer

Option B is the correct answer.

Detailed Explanation

Slide 61 states: 'A while loop allows general repetition based upon the repeated testing of a Boolean condition'.

Hint

Refer to the explanation of the 'while loop' on slide 61.

Question Info