Chapter 2: File handling in Python
1. What is a file? Mention the types of files used in computers.
2. Write any 3 differences between text file and binary file. Give examples for text
file and binary files.
3. Explain any 5 file Access modes(file open modes).
4. Differentiate between the following :
a. read() and readline()
b. readline() and readlines()
c. write()and writelines()
[Link] the use syntax for open () and close () functions
[Link] is the advantage of opening a file using with clause. Write the syntax and
example.
7. Write the use and syntax for tell () and seek () methods
[Link] the use and syntax for load () and dump () methods.
9. Define pickling in Python. What do you mean by serialisation and De-serialisation of
python object?
10. What is the use of pickle module in Python? Mention the methods provided by
puckle module to work with binary files.