import csv
def create():
with open('[Link]','w', newline='') as f:
w = [Link](f)
a = 'y'
while [Link]()=='y':
stuId = int(input('enter the id: '))
name = input('enter name: ')
s1 = int(input('enter subject 1 mark: '))
s2 = int(input('enter subject 2 mark: '))
s3 = int(input('enter subject 3 mark: '))
s4 = int(input('enter subject 4 mark: '))
s5 = int(input('enter subject 5 mark: '))
msum = s1+s2+s3+s4+s5
avg=msum/5
l=[stuId, name, msum, avg]
[Link](l)
a = input('do you want to add more records:(yes,no) ')
def display():
with open('[Link]','r') as f:
r = [Link](f)
print('id' ,'name', 'Sum of all the marks','avg. marks',
sep='\t')
for i in r:
print(i[0], i[1], i[2], i[3], sep='\t')
def search(sid):
with open('[Link]','r') as f:
r = [Link](f)
for i in r:
if int(i[0])==sid:
print('Total marks of',i[1],'is',i[-2])
print('avrage marks of',i[1],'is',i[-1])
ans="y"
while [Link]()=="y":
print("[Link] A CSV File")
print("[Link] The Content File")
print("[Link] Based On StudentID")
choice=int(input("Enter your choice:"))
if choice==1:
create()
if choice==2:
display()
if choice==3:
sid=int(input('enter student Id: '))
search(sid)