Advertisements
Advertisements
प्रश्न
What is the difference between the write mode and append mode?
उत्तर
write mode | append mode |
The write mode creates a new file. | append mode is used to add the data at the end of the file if the file already exists. |
If the file is already existing write mode overwrites it. | Otherwise creates a new one. |
APPEARS IN
संबंधित प्रश्न
Mention the two ways to read a CSV file using Python.
Mention the default modes of the File.
Write a Python program to read a CSV file with default delimiter comma (,).
What is the difference between reader() and DictReader() function?
Write the different methods to read a File in Python.
Write a Python program to write a CSV File with custom quotes.
Write the rules to be followed to format the data in a CSV file.
What is the advantage of using a CSV file for permanent storage? Write a Program in Python that defines and calls the following user-defined functions:
- ADD() - To accept and add data of an employee to a CSV file ‘record.csv’. Each record consists of a list with field elements such as empid, name, and mobile to store an employee id, employee name, and employee salary respectively.
- COUNTR() - To count the number of records present in the CSV file named ‘record.csv’.
Give any one point of difference between a binary file and a CSV file. Write a Program in Python that defines and calls the following user-defined functions:
- add() - To accept and add data of an employee to a CSV file ‘furdata.csv’. Each record consists of a list with field elements such as fid, fname, and fprice to store furniture id, furniture name, and furniture price respectively.
- search() - To display the records of the furniture whose price is more than 10000.
Select the correct output of the code:
S="Amrit Mahotsav @ 75"
A=S.partition (" ")
print(a)