A To-Do List application is a simple yet practical project for learning Python. In this guide, we'll explore how to create a Python To-Do List application that allows users to add, view, and manage tasks. We'll provide sample code to demonstrate the process.


Before you start building a Python To-Do List application, ensure you have the following prerequisites:

  • Python installed on your system.
  • Basic knowledge of Python programming.

Creating the To-Do List

Let's create a basic To-Do List application using Python with a simple text-based interface. Users can add tasks, view their tasks, and mark tasks as completed.

# Create an empty list to store tasks
tasks = []
# Function to add a task
def add_task(task):
print("Task added: " + task)
# Function to view all tasks
def view_tasks():
for index, task in enumerate(tasks):
print(f"{index + 1}. {task}")
# Function to mark a task as completed
def complete_task(index):
if 0 <= index < len(tasks):
completed_task = tasks.pop(index)
print("Task completed: " + completed_task)
print("Invalid task index")
# Main loop
while True:
print("\nTo-Do List Menu:")
print("1. Add Task")
print("2. View Tasks")
print("3. Complete Task")
print("4. Quit")
choice = input("Enter your choice: ")
if choice == "1":
task = input("Enter the task: ")
elif choice == "2":
elif choice == "3":
index = int(input("Enter the task number to complete: ")) - 1
elif choice == "4":
print("Invalid choice")


Building a Python To-Do List application is a great way to practice Python programming and data manipulation. You can expand this project by adding features like saving tasks to a file, setting deadlines, or creating a graphical user interface (GUI).