Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

✅ To-Do List Application

A simple command-line To-Do List application built with Python. This program allows users to add tasks, view tasks, and exit the application through a menu-driven interface.

Built as part of a Python fundamentals training track — focused on core backend logic: lists, loops, and menu-driven program structure.


Features

  • ➕ Add new tasks to your list
  • 📋 View all your saved tasks
  • 🚪 Exit the program safely
  • 🔁 Menu keeps showing until you choose to exit

Demo

===== TO-DO LIST =====
1. Add Task
2. View Tasks
3. Exit

Enter your choice: 1
Enter your task: Study Python
Task added successfully!

===== TO-DO LIST =====
1. Add Task
2. View Tasks
3. Exit

Enter your choice: 2
Your tasks:
- Study Python

===== TO-DO LIST =====
1. Add Task
2. View Tasks
3. Exit

Enter your choice: 3
Thanks for using To-Do List!

How to Run

python todo.py

Requires only Python 3 — no external libraries.


Code

def show_menu():
    print("\n===== TO-DO LIST =====")
    print("1. Add Task")
    print("2. View Tasks")
    print("3. Exit")

def add_task(tasks):
    task = input("Enter your task: ")
    tasks.append(task)
    print("Task added successfully.")

def view_tasks(tasks):
    if not tasks:
        print("No tasks yet. Add one first!")
        return
    print("Your tasks:")
    for task in tasks:
        print(f"- {task}")

def main():
    tasks = []
    while True:
        show_menu()
        choice = input("Enter your choice: ")
        if choice == "1":
            add_task(tasks)
        elif choice == "2":
            view_tasks(tasks)
        elif choice == "3":
            print("Thanks for using To-Do List!")
            break
        else:
            print("Invalid choice. Please enter 1, 2, or 3.")

if __name__ == "__main__":
    main()

What This Project Demonstrates

Concept Where it's used
Lists tasks = [], tasks.append(task)
Menu-driven design show_menu() + if/elif/else on user choice
Functions add_task(), view_tasks(), main()
Loop control while True + break on Exit
Empty state handling if not tasks: check in view_tasks()

Tech Stack

  • Python 3

Author

Tabassum Naseer.

About

A simple command-line To-Do List application built with Python. This program allows users to add tasks, view tasks, and exit the application through a menu-driven interface.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages