← Back to Files
Question 425
Growing To-Do File
Growing To-Do File
Create todo.txt in write mode holding first_task on its own line, then read two more tasks from input and add each one to the file in append mode, opening the file in mode "a" for each. Finally read the file back and print every task on its own line as <number>. <task> counting from 1, trimming the newline with rstrip. Input: two lines, one task each, no prompt.
Expected Output:
1. buy milk 2. call Sam 3. walk the dog
= newline. The output ends with a newline — print one after the last line.
Hints3 available
Sign in to use hintsTopics:
Files
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.