Q7

Week 7 Quiz

File Handling and Data Processing

Student Information

Question 1: Multiple Choice (2 points)

Which function is used to open a file in Python?

Question 2: Multiple Choice (2 points)

What file mode should you use to write to a file (overwriting existing content)?

Question 3: Short Answer (3 points)

Write code to read all lines from a file called 'data.txt' and store them in a list called 'lines':

Question 4: True/False (2 points)

It's important to close files after opening them to free up system resources.

Question 5: Multiple Choice (1 point)

Which statement about CSV files is correct?

← Back to Lesson Semester Overview Next Lesson →