LearnPy Hub
← Classes & Objects problems
Medium

To-Do List

Write class TodoList with add(task), done(number) (1-based) and show(), which prints each task as [x] task or [ ] task. Process commands add …, done N, show until END.

Input

Commands, then END.

Output

Lines.

Sample 1

Input
add buy milk
add study
done 1
show
END
Output
[x] buy milk
[ ] study

Sample 2

Input
add x
show
END
Output
[ ] x
solution.py
Output appears here
To-Do List · Python practice problem · LearnPy Hub