Skip to content

codes #333

@ADITYA-THEE-CODER

Description

@ADITYA-THEE-CODER

tasks = []

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

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

def view_tasks():
if len(tasks) == 0:
print("No tasks yet.")
else:
for i, task in enumerate(tasks, start=1):
print(i, "-", task)

while True:
show_menu()
choice = input("Choose an option: ")

if choice == "1":
    add_task()

elif choice == "2":
    view_tasks()

elif choice == "3":
    print("Goodbye!")
    break

else:
    print("Invalid option")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions