Computer Science, asked by avenger1444, 1 month ago

Write a Python program file to enter name and marks of any three students and store them in a CSV file named STD.CSV. Also print the contents of the file. A function should be used to perform both the tasks.​

Answers

Answered by yogeshbhuyal7
1

In this tutorial, we will learn how to read and write into CSV files in Python with the help of examples.

A CSV (Comma Separated Values) format is one of the most simple and common ways to store tabular data. To represent a CSV file, it must be saved with the .csv file extension.

Let's take an example:

If you open the above CSV file using a text editor such as sublime text

While we could use the built-in open() function to work with CSV files in Python, there is a dedicated csv module that makes working with CSV files much easier.

Before we can use the methods to the csv module, we need to import the module first using:

Similar questions