-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtasktracker.py
More file actions
30 lines (28 loc) · 902 Bytes
/
tasktracker.py
File metadata and controls
30 lines (28 loc) · 902 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
#Stores the variable "tasks" as a list
tasks = []
#Conditionals
while True:
#Asks user for input to select one of the options
action = input("Add/Remove/View/Exit").lower()
if action == "add":
task = input("What task would you like to add? ")
tasks.append(task)
print(f"{task} has been successfully added!")
elif action == "remove":
task = input("What task would you like to remove? ")
if task in tasks:
tasks.remove(task)
print(f"{task} has been successfully removed!")
else:
print("Task could not be found.")
elif action == "view":
if not tasks:
print("No tasks found.")
else:
for t in tasks:
print("•", t)
elif action == "exit":
print("Goodbye!")
break
else:
print("Enter one of the following options.")