Kids Coding

Project: To-Do

Add, list, and remove tasks. A list in memory, then save it to a file.

KidsAdvancedProject: To-Do

A list you can change

A to-do app is a list plus a few actions: show, add, remove. Here the actions run in order so the editor can finish.

Add, list, remove

tasks = []

def show(tasks):
    if not tasks:
        print("(empty)")
        return
    for i, task in enumerate(tasks, start=1):
        print(i, task)

tasks.append("Feed the fox")
tasks.append("Finish homework")
print("After add:")
show(tasks)

tasks.pop(0)
print("After remove first:")
show(tasks)

with open("tasks.txt", "w", encoding="utf-8") as file:
    for task in tasks:
        file.write(task + "\n")
print("Saved")

Save the list to a file so the tasks are still there tomorrow. A to-do app that forgets everything when it closes is not much of a helper.

On a computer

Wrap show, append, and pop in a while True menu that inputs list, add, done, or quit. Same functions. Different driver.

Real life

Saturday chores on the fridge, then crossing one off.

A list you add to and take from. That is a to-do in real life.

Saturday list

chores = ["Wash cups", "Walk the dog"]
chores.append("Tidy desk")
print("To do:")
for chore in chores:
    print("-", chore)
chores.pop(0)
print("After one done:", chores)

Change one word. Run it. That is how this idea shows up outside the lesson.

Try it

Exercise 1: Start with tasks = ["a"]. Append "b". Print the list.

Show solution
tasks = ["a"]
tasks.append("b")
print(tasks)

FAQ: Project: To-Do

Common questions about this page.

What is StudyGrid Kids?

StudyGrid Kids is a free coding path for children: Basic, Intermediate, and Advanced. Lessons use Python in the browser. No account and no install.

Should I run project: to-do examples locally for better learning?

Yes. Use the browser editor on StudyGrid for a quick check, then Download the example and run it on your computer. Local runs show real errors and the real toolchain, which is one of the fastest ways to learn project: to-do in this Kids Coding Python lesson (Project: To-Do).

Which kids level should we start with?

Start at Basic if the child has never written code. Choose Intermediate if they can print, use variables, and write a simple if. Choose Advanced if they already use loops and lists.

Do kids need an account or an app?

No. Kids pages are public. Code runs in the Try Python editor at /try. We do not ask children for a name or an email.

What language do kids learn?

Python, with a first HTML page in Intermediate and Advanced. After Advanced, the main Python tutorial is the next step.

Is the kids coding track free?

Yes. The Kids home, the three levels, and the Python editor on StudyGrid (studygrid.in) are free.