Medium
Write a CSV With DictWriter
Read n lines of
name mark. Write them to marks.csv with csv.DictWriter and a header row name,mark. Then print the file contents, and finally the name of the top scorer (first if tied).Input
n, then n lines.
Output
Several lines.
Sample 1
Input
2 Mim 80 Rafi 90
Output
name,mark Mim,80 Rafi,90 Rafi
Sample 2
Input
1 A 5
Output
name,mark A,5 A
Output appears here