tasks = []
def show_tasks():
if tasks:
print("\nYour Tasks:")
for i, task in enumerate(tasks, 1):
print(f"{i}. {task}")
else:
print("\nNo tasks yet!")
while True:
action = input("\n(add/view/remove/exit): ").strip().lower()
if action == "add":
tasks.append(input("Enter task: "))
elif action == "view":
show_tasks()
elif action == "remove":
show_tasks()
try:
tasks.pop(int(input("Task number: ")) - 1)
except:
print("❌ Invalid number!")
elif action == "exit":
break
else:
print("Invalid option! Try again.")