Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
127 views1 page

3 RD

Uploaded by

kunalkashyap5322
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
127 views1 page

3 RD

Uploaded by

kunalkashyap5322
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

#Q1.

Write a program to read following details of sports


performance(sports,competition,prizes-won) of your school and store into a csv file
delimited with tab character

import csv
fh=open("Sports.csv","w")
swriter=csv.writer(fh,delimiter='\t')
swriter.writerow(['Sport','Competition','Prizes won'])
ans='y'
i=1
while ans=='y':
print("Record",i)
sport=input("Sport Name:")
comp=int(input("Competition:"))
prizes=int(input("Prizes won:"))

srec=[sport,comp,prizes]
swriter.writerow(srec)
i=i+1
ans=input("More records? (y/n) :")

fh.close()

Pg 5

You might also like