2. Programming

File I/o — Quiz

Test your understanding of file i/o with 5 practice questions.

Read the lesson first

Practice Questions

Question 1

Which of the following best describes the behavior of the 'tell()' method when working with file I/O in Python?

Question 2

In Python, which of the following correctly describes the behavior of the 'seek(offset, whence)' method when working with files?

Question 3

Which of the following statements about reading and writing binary files in Python is correct?

Question 4

You have a file containing JSON data. Which of the following is the correct way to read and parse the JSON data into a Python dictionary?

Question 5

Which of the following best describes how to properly handle file-related errors when reading from a file in Python?