Bird
Raised Fist0

Which of the following statements about flushing output in Python is TRUE?

easy🧠 Conceptual Q2 of Q15
Python - File Reading and Writing Strategies
Which of the following statements about flushing output in Python is TRUE?
AFlushing delays output until the buffer is full
BFlushing clears the output buffer without writing
CFlushing forces the buffer to write its contents immediately
DFlushing only works with input streams
Step-by-Step Solution
Solution:
  1. Step 1: Define flushing in output context

    Flushing means forcing the buffered output to be written immediately to the output device.
  2. Step 2: Evaluate each option

    Only Flushing forces the buffer to write its contents immediately correctly describes flushing as forcing immediate write of buffered data.
  3. Final Answer:

    Flushing forces the buffer to write its contents immediately -> Option C
  4. Quick Check:

    Flushing = Immediate buffer write [OK]
Quick Trick: Flush means force output now, not later [OK]
Common Mistakes:
MISTAKES
  • Confusing flushing with clearing buffer
  • Thinking flushing delays output
  • Assuming flushing applies to input only

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes