Learn Without Walls
← Back to Module 11

Module 11 Quiz

Test your knowledge of File Handling • 12 Questions

Question 1

What does the "r" mode do when opening a file?

Question 2

What happens if you open a file with "w" mode and the file already exists?

Question 3

What does file.read() return?

Question 4

What is the main advantage of using the with statement for file handling?

Question 5

What does file.readlines() return?

Question 6

Which mode should you use to add data to the end of an existing file without erasing it?

Question 7

Why do we use line.strip() when reading lines from a file?

Question 8

What does CSV stand for?

Question 9

What is the advantage of csv.DictReader over csv.reader?

Question 10

When writing a CSV file, why should you include newline="" in the open() call?

Question 11

What does the write() method return?

Question 12

What happens if you try to open a non-existent file with "r" mode?

Quiz Results


Back to Module 11