Python Beginner Lesson 10: Console To-Do List Mini Project

In Python Beginner Lesson 10, we cover console To-Do project in detail at a beginner-friendly level. The final goal of this lesson is to combine variables, conditionals, loops, lists, and functions to complete a small app. Instead of stopping at copying code, we also check why this syntax is used and where beginners often make mistakes.

When you learn syntax separately, it may seem clear, but connecting it in a real program can feel confusing. A mini project trains you to connect the basics into one flow. Today’s example is small, but it becomes a basic skeleton for later automation, data analysis, and web API learning.

What You Will Learn in This Lesson

  • Core topic: console To-Do project
  • Today’s goal: combine variables, conditionals, loops, lists, and functions to complete a small app
  • Practice flow: understand the concept → run the example → review the code → try an applied task
  • Recommended study time: 30–50 minutes

Understand the Big Picture First

Python Beginner Lesson 10: Console To-Do List Mini Project - The To-Do project connects lists, dictionaries, functions, and loops inside one small program.
The To-Do project connects lists, dictionaries, functions, and loops inside one small program.

When learning console To-Do project, the most important thing is not memorizing grammar names. You need to understand what role this concept plays inside a real program. At the beginner stage, keep asking the following three questions.

  • Where did this value come from?
  • In what order does this code run?
  • Where should I save the result if I want to use it again?

Look Closely at the Core Concepts

  • A project becomes easier when you decide the feature list first.
  • To-Do data can be represented by putting dictionaries inside a list.
  • If you divide adding, showing, and completing tasks into functions, the code is easier to manage even when it grows longer.

At first, explanations alone may feel abstract. That is why it is helpful to run the example below right away and check the concept with your own eyes.

Beginner Terms You Should Know

TermSimple explanation
CRUDCreate, Read, Update, Delete: the basic operations for making, reading, modifying, and deleting data
Menu loopA structure that repeatedly shows a menu until the user chooses to exit
State valueA value that represents the current state of data, such as whether a task is complete

Practice Setup

Create a new Python file and run the example below. Using lowercase English letters and numbers in the file name helps reduce errors. For example, save it as lesson.py or practice_01.py. After entering the code, do not change many things at once. Change it little by little while checking the result each time.

Example Code

Python Beginner Lesson 10: Console To-Do List Mini Project - When you directly test adding tasks, viewing the list, and marking completion, you can understand how a program changes state.
When you directly test adding tasks, viewing the list, and marking completion, you can understand how a program changes state.

When you directly test adding tasks, viewing the list, and marking completion, you can understand how a program changes state.

todos = []

def add_todo(text):
    todos.append({"text": text, "done": False})

def show_todos():
    if not todos:
        print("No tasks have been registered.")
        return
    for i, todo in enumerate(todos, start=1):
        mark = "Done" if todo["done"] else "In progress"
        print(f"{i}. [{mark}] {todo['text']}")

def complete_todo(number):
    index = number - 1
    if 0 <= index < len(todos):
        todos[index]["done"] = True

add_todo("Review Python Lesson 10")
add_todo("Review loops again")
complete_todo(1)
show_todos()

Understand the Code Line by Line

  • The todos list stores every task.
  • Each task is a dictionary with text and done.
  • enumerate(…, start=1) is used to show numbers starting from 1 to the user.
  • Because the number chosen by the user is 1 greater than the list index, number – 1 is calculated.

At this stage, the important thing is the “reading order” of the code. Python runs from top to bottom. Even when there are exceptional flows such as functions or conditionals, beginners should first get used to the basic top-to-bottom flow.

Change Values and Check the Result

If the example code ran successfully, now change only a very small part. Start with small changes such as one number, one string, or one variable name so errors are easier to find. After each change, always save and run the code again.

Part to changeWhat to check
Input value or variable valueCheck how the result sentence changes.
Output sentenceCheck whether it becomes a friendlier explanation for the user.
Code orderCheck whether changing the order causes an error or changes the result.

Common Errors and How to Fix Them

Error or situationWhy it happensHow to fix it
IndexErrorThis is a common beginner-level problem.It occurs when the user number and the list index are not matched correctly.
Too many features in one functionThis is a common beginner-level problem.Dividing code into functions by feature makes it easier to modify.
Confusing data structuresThis is a common beginner-level problem.Decide first whether one task should be a string or a dictionary.

When an error appears, first look at the last line of the error message. Then check the file name and line number. Most beginner errors come from parentheses, quotation marks, indentation, variable names, and type conversion.

Practice Problems to Try on Your Own

  • Add a delete feature.
  • Repeat the menu with a while loop.
  • After the next lesson, add a feature that saves tasks to a file.

When solving practice problems, do not search for the answer code right away. First write the input, processing, and output flow on paper. Once the flow is visible, the code becomes much easier to write.

Where Does This Connect in Real Work?

Console to-do project does not end with a small example. It keeps appearing in business automation when organizing files, in data analysis when reading table data, and in web API work when handling response values. The beginner syntax you learn now also becomes the basic language for using tools such as pandas, requests, and FastAPI later.

An Analogy for Beginners

When you first see console To-Do project, syntax symbols may catch your eye before anything else. But if you see syntax only as symbols, you get tired quickly. A better method is to understand it by role. The core of this lesson is combine variables, conditionals, loops, lists, and functions to complete a small app. In other words, you are practicing how to decide what task to give Python and write the processing order as code.

Think of a cooking recipe. You prepare ingredients, process them in order, control the heat, and finally put the result on a plate. Python code is similar. You prepare the necessary values, process them in a defined order, and print or save the result. For beginners, developing this sense of order is most important.

Follow the Execution Flow Visually

Before running code, divide your thinking into the three columns below. This habit helps not only with simple examples but also later when you build longer projects.

SectionCheck questionMeaning in this lesson
InputWhat value does the program receive first?Values entered by the user or written in advance in the console To-Do project example.
ProcessingWhat calculation or decision is made?The part Python runs in order to achieve: combine variables, conditionals, loops, lists, and functions to complete a small app.
OutputWhat result does the user check?This may be a print result, saved file, generated graph, or changed data.

Simply filling in this table yourself improves your code-reading ability. Beginners often struggle because they do not know syntax, but more often because they cannot separate input, processing, and output flow.

Debugging Routine: What to Check When an Error Happens

When an error occurs, do not delete code at random. If you check in the following order, you can find most beginner errors on your own.

  • Read the last line of the error message.
  • Check the file name and line number.
  • On that line, check whether parentheses, quotation marks, colons, and commas match.
  • Check whether the variable name is exactly the same as the name defined earlier.
  • Check whether a value that should be calculated as a number is still a string.
  • Undo the part you just changed and run the code again.

If you repeat this routine, errors begin to look less scary and more like clues. Python skill grows more from reading and fixing errors than from avoiding errors.

Application Direction: Grow Today’s Lesson a Little Further

Once you are comfortable with this example, keep console To-Do project as the base and change one thing among the input value, output message, storage method, or repeat count. You do not need to build a completely new example. At the beginner stage, many small variations are best.

  • Change the variable names in the example to make them more meaningful.
  • Refine the output sentence so it reads like a guide shown to a real user.
  • Intentionally test what happens when invalid input is entered.
  • Explain the code with comments and check what you understand.
  • Try making the same result in a slightly different way.

Lesson Checkpoints

  • ☐ I can explain in words why console To-Do project is needed.
  • ☐ I ran the example code myself.
  • ☐ I can explain the role of at least three lines of code.
  • ☐ When an error occurred, I checked the last line and the line number.
  • ☐ I changed and ran at least one practice problem on my own.

Related Articles

FAQ

Can I follow Python console To-Do project even if I am completely new to Python?

Yes. This lesson is written for readers who are learning programming for the first time. Focus on understanding the execution result and flow rather than memorizing the code.

I followed the example exactly, but I get an error. What should I check first?

Check parentheses, quotation marks, colons, indentation, and variable names first. Many beginner errors happen because quotation marks were entered strangely or a variable name differs by one character.

The example code looks too short. Should I study longer code?

At the beginner level, short code is better. The most stable way to improve is to understand short code accurately, then change values and add features one by one.

What should I do next?

Change and run at least one practice problem from this lesson. Then move to the next lesson, where the concepts you learned earlier will appear again naturally.

Next Lesson Preview

The next lesson is Python Beginner Lesson 11: Understanding Modules, Packages, and import. Based on the flow you practiced here, you will explore modules and packages in more detail.

References

Original Korean article: https://www.thinknote.co.kr/python-beginner-10-console-todo-project/