Quiz on Python File Handling



1. What mode is used to open a file for reading in Python?
2. Which method is used to read the entire content of a file in Python?
3. What does the 'w' mode do when opening a file?
4. Which method can be used to close a file in Python?
5. How can you read a single line from a file in Python?

Advertisements