0% found this document useful (0 votes)
3 views1 page

Chapter2 - Assignment Questions

Chapter 2 covers file handling in Python, discussing what files are and their types, along with differences between text and binary files. It explains various file access modes, the differences between read methods, and the syntax for open and close functions. Additionally, it introduces the advantages of using the 'with' clause, the tell and seek methods, pickling, serialization, and the pickle module's methods for working with binary files.

Uploaded by

nishansalian77
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Chapter2 - Assignment Questions

Chapter 2 covers file handling in Python, discussing what files are and their types, along with differences between text and binary files. It explains various file access modes, the differences between read methods, and the syntax for open and close functions. Additionally, it introduces the advantages of using the 'with' clause, the tell and seek methods, pickling, serialization, and the pickle module's methods for working with binary files.

Uploaded by

nishansalian77
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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.

You might also like