This is a simple interactive to-do list application built entirely in Python for use in the command line (or terminal). It allows users to manage their tasks by adding new items, viewing existing ones, marking tasks as complete, and deleting them.
This project is an excellent exercise for beginners to understand core Python concepts like lists, loops, conditional statements, and user input/output in a practical application.
- Add Task: Easily add new to-do items to your list.
- View Tasks: Display all current tasks with their corresponding numbers.
- Mark Task as Complete: Mark a task as done by its number (adds "(DONE)" to the task description).
- Delete Task: Remove a task from the list using its number.
- User-Friendly Interface: Simple numbered menu for easy navigation.
- Persistent Session (in-memory): Tasks are stored as long as the application is running (they are cleared when the program exits).
To run this To-Do List application, you'll need Python installed on your computer.
- Python 3.x (Make sure you have a recent version of Python 3 installed.)
-
Save the code:
- Save the Python code for the To-Do List (from our previous conversation) into a file named
todo_list.py. - Place this file in a convenient folder on your computer (e.g.,
Documents/PythonProjects/todo-app).
- Save the Python code for the To-Do List (from our previous conversation) into a file named
-
Open your Command Prompt / Terminal:
- On Windows: Navigate to the folder where you saved
todo_list.pyin File Explorer. Click on the address bar at the top, typecmd, and pressEnter. - On Mac/Linux: Open your Terminal application. Use the
cdcommand to navigate to the directory where yourtodo_list.pyfile is located. For example:cd ~/Documents/PythonProjects/todo-app.
- On Windows: Navigate to the folder where you saved
-
Execute the Python script:
- Once you are in the correct directory in your Command Prompt/Terminal, type the following command and press
Enter:python todo_list.py
- Once you are in the correct directory in your Command Prompt/Terminal, type the following command and press
-
Interact with the To-Do List:
- The application will start, display a menu, and prompt you for a choice.
- Type the number corresponding to the action you want to perform (e.g.,
1to add a task,2to view tasks). - Follow the on-screen instructions.
- To exit the application, type
5and pressEnter.
listdata structure for task storage.whileloops for continuous program execution.if/elif/elsefor menu navigation and conditional logic.input()for user interaction.print()for displaying information.- Basic error handling (
try-exceptfor number input,ifstatements for valid choices/numbers). - Functions (
def) for organizing code into reusable blocks.
This project is a great starting point for learning Python. Feel free to explore, modify, and improve it! Suggestions and enhancements are welcome.
This project is open-source and available under the MIT License.