CJCoding With Joseph
15free / daySign inCreate account

To-Do List Manager

Write a to-do list kept in a list of strings that starts empty. Show the menu 1) View tasks, 2) Add task, 3) Remove task, 4) Quit and read the choice with the prompt Choice: , stripped. View prints No tasks yet. when the list is empty, otherwise one line per task in the form <number>. <task>, numbered from 1 with a counter. Add reads a task with the prompt Task: ; a blank task prints Nothing added - the task was blank., otherwise it is appended with .append() and Added: <task> is printed. Remove prints Nothing to remove. when the list is empty; otherwise it reads a line with the prompt Task number: , prints No task number <text>. when the text is not all digits (.isdigit()) or is outside 1 to the length of the list, and otherwise takes the task out with tasks.pop(number - 1) and prints Removed: <task>. Quit prints Goodbye! and leaves the loop; anything else prints Unknown choice - try again.. Input: one line per choice, task or task number, ending with 4. Prompts are part of the output, so each message follows the last prompt on the same line.

Expected Output:

1) View tasks
2) Add task
3) Remove task
4) Quit
Choice: Task: Added: Buy milk
1) View tasks
2) Add task
3) Remove task
4) Quit
Choice: Task: Added: Call mum
1) View tasks
2) Add task
3) Remove task
4) Quit
Choice: 1. Buy milk
2. Call mum
1) View tasks
2) Add task
3) Remove task
4) Quit
Choice: Task number: Removed: Buy milk
1) View tasks
2) Add task
3) Remove task
4) Quit
Choice: 1. Call mum
1) View tasks
2) Add task
3) Remove task
4) Quit
Choice: Goodbye!

= newline. The output ends with a newline — print one after the last line.

Hints4 available
Topics:
Menus & Validation
📥 Auto-Input:
2\nBuy milk\n2\nCall mum\n1\n3\n1\n1\n4\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.