-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
31 lines (26 loc) · 786 Bytes
/
app.py
File metadata and controls
31 lines (26 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import sys
def show_menu():
print("\n--- MISSION CONTROL ---")
print("1. View Tasks")
print("2. Add Task")
print("3. Exit")
def main():
tasks = ["Create TaskMaster", "Install Homebrew"]
while True:
show_menu()
choice = input("Select an option (1-3): ")
if choice == "1":
print("\nYOUR TASKS:")
for i, task in enumerate(tasks, 1):
print(f"{i}. {task}")
elif choice == "2":
new_task = input("Enter the new task: ")
tasks.append(new_task)
print("Task added!")
elif choice == "3":
print("Goodbye!")
sys.exit()
else:
print("Invalid choice, try again.")
if __name__ == "__main__":
main()