Skip to content

This is a small project I made in Python — a To-Do List app that runs in the terminal. The idea is simple: you can add tasks, mark them as done, and remove them when finished. It helps keep track of what you need to do in a clean and minimal way.

Notifications You must be signed in to change notification settings

Anu-2704/Python-programming-Task1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Python-programming-Task1

Simple To-Do List Application in Python

tasks = [] # list to store tasks

def show_tasks(): if not tasks: print("\nYour to-do list is empty!") else: print("\nYour To-Do List:") for i, task in enumerate(tasks, 1): print(f"{i}. {task}")

def add_task(): task = input("\nEnter a new task: ") tasks.append(task) print("Task added successfully!")

def update_task(): show_tasks() try: task_num = int(input("\nEnter the task number to update: ")) if 1 <= task_num <= len(tasks): new_task = input("Enter the updated task: ") tasks[task_num - 1] = new_task print("Task updated successfully!") else: print("Invalid task number.") except ValueError: print("Please enter a valid number.")

def delete_task(): show_tasks() try: task_num = int(input("\nEnter the task number to delete: ")) if 1 <= task_num <= len(tasks): removed = tasks.pop(task_num - 1) print(f"Task '{removed}' deleted successfully!") else: print("Invalid task number.") except ValueError: print("Please enter a valid number.")

def main(): while True: print("\n--- TO-DO LIST MENU ---") print("1. Show Tasks") print("2. Add Task") print("3. Update Task") print("4. Delete Task") print("5. Exit")

    choice = input("Choose an option (1-5): ")

    if choice == "1":
        show_tasks()
    elif choice == "2":
        add_task()
    elif choice == "3":
        update_task()
    elif choice == "4":
        delete_task()
    elif choice == "5":
        print("Goodbye! 👋")
        break
    else:
        print("Invalid choice. Please try again.")

Run the program

main()

About

This is a small project I made in Python — a To-Do List app that runs in the terminal. The idea is simple: you can add tasks, mark them as done, and remove them when finished. It helps keep track of what you need to do in a clean and minimal way.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published