12 is writing a program to read the details of Sports performance and store in the
csv file "Sports.csv" delimited with a tab character. As a programmer, help him to achieve the
task. [ Answer any 4 ]. 4
import ___________ # Line 1
f = open("Sports.csv","a")
wobj = csv.______________ (f, delimiter = ‘\t’) # Line 2
wobj.writerow( [‘Sport’, ‘Competitions’, ‘Prizes Won’] )
ans = ‘y’
i = 1
while ans == ‘y’:
print("Record :", i)
sport = input("Sport Name :")
comp = int(input("No. of competitions participated :"))
prize = int(input("Prizes won:"))
record = ____________________ # Line 3
wobj.______________ (rec) # Line 4
i += 1
ans = input("Do u want to continue ? (y/n) :")
f.___________ # Line 5
a) Name the module he should import in Line 1
b) To create an object to enable to write in the csv file in Line 2
c) To create a sequence of user data in Line 3
d) To write a record onto the writer object in Line 4
e) Fill in the blank in Line 5 to close the
Answers
Answered by
0
Answer:
sorry I don't understand your answer
Similar questions