Bird
0
0

What output appears on the Raspberry Pi display after this code?

medium📝 Predict Output Q5 of 15
Raspberry Pi - Display and Output
What output appears on the Raspberry Pi display after this code?
count = 3
while count > 0:
    print(count)
    count -= 1
print('Done')
A1 2 3 Done
B3 2 1
C3 2 1 Done
DDone 3 2 1
Step-by-Step Solution
Solution:
  1. Step 1: Trace the while loop output

    Loop prints 3, then 2, then 1 as count decreases.
  2. Step 2: Note the final print after loop ends

    After count reaches 0, 'Done' is printed.
  3. Final Answer:

    3 2 1 Done -> Option C
  4. Quick Check:

    Loop output + final print = 3 2 1 Done [OK]
Quick Trick: Loops print values before decreasing count [OK]
Common Mistakes:
MISTAKES
  • Mixing order of numbers
  • Missing final print statement

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Raspberry Pi Quizzes