Question Detail
Question
Consider the Python code snippet from slide 11:
count = 0
while count >= 10:
count += 1
print(count)
What is the expected output?
Correct Answer
Option D is the correct answer.
Detailed Explanation
The
while loop condition is count >= 10. Initially, count is 0. Since 0 is not greater than or equal to 10, the loop condition is false from the start. The loop body will never execute, and therefore nothing will be printed. 'None of the above' is the correct choice as it implies no output or a different output than the given options.
Hint
Pay close attention to the initial value of 'count' and the loop condition. Will the loop ever start?