Theory on CSV Files
# Introduction A CSV (Comma Separated Values) file is a simple type of text file used to store data in a table format. It's commonly used for exchanging data because it's easy to read and create. Each line in a CSV file represents a row in the table, and commas are used to separate the values in each column. CSV files have .csv as file extension. Let us take a CSV file named data.csv which has the following contents: Roll No., Name of student, stream, Marks 1, Panda, Science, 426 2, Piyush, Science, 445 As you can see each row is a new line, and each column is separated with a comma. This is an example of how a CSV file looks like. To work with csv files, we have to import the csv module in our program. # Read a CSV file: To read data from a CSV file, we have to use reader( ) function. The reader function takes each row of the file and make a list of all columns. ...