#program to create a csv file and store employee data and search any #employee if not found display message
Answers
Answer:
6. Write a statement in Python to perform the following operations:
(a) To open a text file "Book.txt" in read mode
(b) To open a binary file "Book.dat" in write mode
Ans. (a) f = open("Book.txt", "r")
(b) f = open("Book.dat", "wb")
7. What is a CSV file?
Ans. CSV (Comma Separated Values) is a simple file format used to store tabular data, such as a spreadsheet
or database. A CSV file stores tabular data (numbers and text) in plain text.
8. What are the advantages of CSV file formats?
Ans. Advantages:
(a) A simple, compact and ubiquitous format for data storage.
(b) A common format for data interchange.
(c) It can be opened in popular spreadsheet packages like MS-Excel, Cal, etc.
(d) Nearly all spreadsheets and databases support import/export to csv format.
9. Differentiate between a text file and a binary file.
Ans. A text file stores data as ASCII/UNICODE characters whereas a binary file stores data in binary format
(as it is stored in memory). Internal conversion is required in text file and, hence, slower but binary file
does not need any translation and is faster