Objective
A to-do list that persists in a JSON file: at the start it loads the file if it exists and at the end it saves it.
Instructions
- The file
tareas.jsoncontains a list of objects with the keysid,titleanddone(boolean). If it does not exist, start with an empty list. - The first line has the number
nof commands:add title(the title is the rest of the line; theidis the highest existing plus 1; showOK id),done id,remove id(showOKorError: task not found) andlist(one lineid [x] titleper task, orNo tasksif there are none). - When finished save the list to
tareas.jsonwithindent=2andensure_ascii=False.
4
add comprar pan
add llamar
done 1
list
OK 1
OK 2
OK
1 [x] comprar pan
2 [ ] llamar
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise