Loading...
Loading...
Loading...
Convert CSV lines with the header name,mark into JSON text: a list of objects where mark is an integer. Print it on one line with json.dumps.
Example
Input
3 name,mark Asha,82 Ravi,67
Output
[{"name": "Asha", "mark": 82}, {"name": "Ravi", "mark": 67}]Two objects.
Try the problem first. Open one hint at a time.
Build a new dictionary for each row so the mark can be an int.
Print the list with json.dumps.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor