This is an interactive to-do list application built purely in Python, designed to run in your command line or terminal. It offers standard task management features but includes a unique visual flair for completed items, making it easy to distinguish your progress.
This project is great for beginners to understand core Python concepts like lists, dictionaries, loops, conditional statements, and user input/output in a practical, fun way.
- Add Task: Easily add new to-do items to your list.
- View Tasks: Display all current tasks with their corresponding numbers and completion status.
- Mark Task as Complete: Mark a task as done by its number. Completed tasks are visually "crossed out" with a distinct hyphenated format (e.g.,
---W-O-R-K-----) and marked with[X]. - Delete Task: Remove a task from the list using its number.
- User-Friendly Interface: Simple numbered menu for easy navigation.
- In-Memory Storage: Tasks are stored as long as the application is running (they are cleared when the program exits).
When you mark a task like "Work" as complete, it will transform from [ ] Work to something like:
[X] ---W-O-R-K-----
This provides a clear and unique visual indicator of completion.
To run this To-Do List application, you'll need Python installed on your computer.
- Python 3.x (Ensure you have a recent version of Python 3 installed.)
-
Save the code:
- Save the Python code for the To-Do List 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 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 storing multiple tasks.dictionarydata structure for storing task details (description and completion status).whileloops for continuous program execution.if/elif/elsefor menu navigation and conditional logic.input()for user interaction.print()for displaying information.- String methods (
.strip(),.upper(),.join()) for text manipulation and formatting. - Basic error handling (
try-exceptfor number input,ifstatements for valid choices/numbers). - Functions (
def) for organizing code into reusable blocks.
This project is a fantastic starting point for learning Python. Feel free to explore the code, make modifications, and enhance its features! Suggestions and improvements are always welcome.
This project is open-source and available under the MIT License.