Bird
Raised Fist0

Which mode should you use to open a CSV file for appending new rows without deleting existing data?

easy🧠 Conceptual Q2 of Q15
Python - Structured Data Files
Which mode should you use to open a CSV file for appending new rows without deleting existing data?
A'a' (append mode)
B'w' (write mode)
C'r' (read mode)
D'x' (exclusive creation mode)
Step-by-Step Solution
Solution:
  1. Step 1: Understand file modes for CSV files

    Mode 'r' reads, 'w' overwrites, 'a' appends, and 'x' creates new file exclusively.
  2. Step 2: Identify mode for adding data without deleting

    To add rows without deleting existing data, use 'a' (append mode).
  3. Final Answer:

    'a' (append mode) -> Option A
  4. Quick Check:

    Append mode = 'a' [OK]
Quick Trick: Use 'a' mode to add data without erasing [OK]
Common Mistakes:
MISTAKES
  • Using 'w' which erases existing data
  • Using 'r' which only reads
  • Confusing 'x' with append mode

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes