What is the output of the following program?
import csv d=csv.reader(open('c:\PYPRG\ch13\city.csv'))
next(d)
for row in d: print(row)
if the file called “city.csv” contain the
following details
chennai,mylapore
mumbai,andheri
What will be written inside the file test.csv
using the following program import csv
D = [['Exam'],['Quarterly'],['Halfyearly']]
csv.register_dialect('M',lineterminator = '\n')
with open('c:\pyprg\ch13\line2.csv', 'w') as f:
wr = csv.writer(f,dialect='M')
wr.writerows(D)
f.close()