CSV file assignment using Python
CSV file assignment using Python is meant for computer science students. This CSV file assignment contains the basic operations that we can perform on CSV file like creating a CSV file, reading a csv file, deleting a record from CSV file and updating CSV file.
Q1. suppose a CSV file ‘student.csv’ is already available to you with the following records. write a python program to read this csv file and display its contents on the screen.
reading a csv file in python
import csv file = open('student.csv','r') data = csv.reader(file) for record in data: print(record) file.close()
Q2. Write a Python program to create a CSV file ‘student.csv’ for the following data