Q23Multiple correct3 Marks24 Dec 2023
Consider the following snippet:
This code produces the given output:
{'Kubra': {'Math': 80, 'Chemistry': 90}, 'Livin': {'Physics': 85, 'Biology': 88}}
Which of the following could be the contents of the file `marks.csv`? Select all possible answers. Note that dictionaries store keys from left to right in the order in which they are inserted. Once a key has been inserted into a dictionary, its order with respect to other keys doesn't change, unless it is deleted and reinserted.
```
f = open('marks.csv', 'r')
D = dict()
for line in f:
name, subject, mark = line.strip().split(',')
mark = int(mark)
if name not in D:
D[name] = dict()
D[name][subject] = mark
print(D)
```