File Handling || Fill in the Blanks || Class 12




1. _____ in Python are interpreted as a sequence or stream of bytes stored on some storage media.

2. The _____ function creates a file object used to call other support methods associated with it.

3. Files in Python can be opened in one of the three modes - _____, _____ and _____.

4. The _____ method writes a list of strings to a file.

5. The _____  method of a file object flushes any unwritten information and closes the file object.

6. The name of the current working directory can be determined using _____ method.

7. The_____ method is used to rename the file or folder.

8. The _____ method is used to remove/delete a file.

9. A _____ file is a series of 1's and 0's, treated as raw data and read byte-by-byte.

10. The _____ statement automatically closes the file after the processing on the file gets over.

11. The read() function reads data from the _____ of a file.

12. The pickle module produces two main methods called _____ and ____ for writing and  reading operations.

13. The readlines() returns a list of lines from the file till _____.

14. The _____ method reads 'n' characters from the file.

15. _____ function is used to force transfer of data from buffer to file.

16. _____ format is a text format accessible to all applications across several platforms.

17. _____ method is used for random access of data in a CSV file.

18. _____ method of pickle module is used to write an object into binary file.

19. _____ method of pickle module is used to read data from a binary file.

20. _____ statement is given for importing csv module into your program.

21. _____ is a string method that joins all values of each row with comma separator in CSV.

22. _____ object contains the number of the current line in a CSV file.

23. To end all the file contents in the form of a list, _____ method may be used.

24. To read all the file contents, _____ method is used.

25. To force Python to write the contents of file buffer on to storage file, _____ method may be used.

26. The default file-open mode is _____ mode.

27. A _____ governs the type of operations (e.g., read/write/append) possible in the opened file.

28. The two types of data files can be _____ files and _____ files.

29. The other name for file object is _____.

30. The _____ file mode will open a file for read and write purpose.

31. The _____ file mode will open a file for write and read purpose.

32. To close an open file, _____ method is used.

33. To read all the file contents in form of a list, ______ method is used.

34. To write a list in a file, _____ method may be used.

35. To force Python to write the contents of file buffer on to storage file, _____ method may be used.


Answers:

1. Files
2. open()
3. read ('r'), write ('w'), append ('a')
4. writelines()
5. close()
6. getcwd()
7. rename()
8. remove()
9. binary
10. with
11. (beginning)
12. dump(), load()
13. end of file (EOF)
14. read(n)
15. flush()
16. CSV
17. seek()
18. dump()
19. load()
20. import csv
21. join()
22. line_num
23. readlines()
24. writelines()
25. flush()
26. read
27. file mode
28. text, binary
29. file handle
30. r+
31. w+ or a+
32. close()
33. readlines()
34. writelines()
35. flush()

9 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post