-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathapp.py
61 lines (53 loc) · 1.36 KB
/
app.py
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
todos = []
stop = False
def get_todos():
global todos
return todos
def add_one_task(title):
# your code here
pass
def print_list():
global todos
pass
def delete_task(number_to_delete):
# your code here
pass
def save_todos():
# your code here
pass
def load_todos():
# your code here
pass
# Below this code will only run if the entry file running was app.py
if __name__ == '__main__':
while stop == False:
print("""
Choose an option:
1. Add one task
2. Delete a task
3. Print the current list of tasks
4. Save todo's to todos.csv
5. Load todo's from todos.csv
6. Exit
""")
response = input()
if response == "6":
stop = True
elif response == "3":
print_list()
elif response == "2":
print("What task number you want to delete?")
number_to_delete = input()
delete_task(number_to_delete)
elif response == "1":
print("What is your task title?")
title = input()
add_one_task(title)
elif response == "4":
print("Saving todo's...")
save_todos()
elif response == "5":
print("Loading todo's...")
load_todos()
else:
print("Invalid response, asking again...")