File Handling Quiz

File Handling in Python Quiz

📘 File Handling in Python - MCQ Quiz

1. Which function is used to open a file in Python?
2. What is the default mode of the open() function?
3. Which method is used to read the entire file content?
4. Which file mode is used for appending data?
5. What does the 'b' in mode 'rb' stand for?
6. Which function is used to close a file?
7. What happens if you open a file in 'w' mode that already exists?
8. The 'with' statement is used to:
9. Which method reads one line from a file?
10. What is the correct way to check if a file exists?
11. Which module is used to remove a file?
12. What is returned by readlines() method?
13. Which mode creates a new file and opens it for writing?
14. What type of data is returned when reading binary files?
15. Which statement best practices file handling in Python?

Comments

Popular posts from this blog

Topic1 :- What is Python Programming?

Topic2: -Why Python?

Topic7: What is Numpy?