We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c1fc189 + 2ab9ce3 commit 11b225dCopy full SHA for 11b225d
1 file changed
Python/projects/ToDoList.py
@@ -0,0 +1,37 @@
1
+# Simple To-Do List Manager (20-30 LOC)
2
+
3
+tasks = []
4
5
+def show_menu():
6
+ print("\n1. Add Task\n2. View Tasks\n3. Remove Task\n4. Exit")
7
8
+while True:
9
+ show_menu()
10
+ choice = input("Choose: ")
11
12
+ if choice == "1":
13
+ task = input("Enter task: ")
14
+ tasks.append(task)
15
+ print("Task added!")
16
17
+ elif choice == "2":
18
+ if not tasks:
19
+ print("No tasks yet.")
20
+ else:
21
+ for i, t in enumerate(tasks, 1):
22
+ print(f"{i}. {t}")
23
24
+ elif choice == "3":
25
+ num = int(input("Task number to remove: "))
26
+ if 1 <= num <= len(tasks):
27
+ tasks.pop(num - 1)
28
+ print("Task removed!")
29
30
+ print("Invalid number.")
31
32
+ elif choice == "4":
33
+ print("Goodbye!")
34
+ break
35
36
37
+ print("Invalid choice, try again.")
0 commit comments