-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtodo.py
More file actions
32 lines (26 loc) · 791 Bytes
/
todo.py
File metadata and controls
32 lines (26 loc) · 791 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
32
todo_file = open("todo.txt",'w')
def print_todo(live = None):
print("*"*100)
print("You have the following contents on your todo: \n")
if live is not None:
for i, todo in enumerate(live):
print(f"{i+1}. {todo}")
return 0
my_file = open('todo.txt','r').readlines()
for i, todo in enumerate(my_file):
print(f"{i+1}. {todo}")
todo_list = []
while True:
print("="*100)
inp = input("DO you want to add to your todo list?: ")
print("="*100)
if ((inp.upper() == "Y") or (inp.upper() == "YES")):
write = input("Write your todo here: ")
todo_file.write(write)
todo_file.write('\n')
todo_list.append(write)
print_todo(todo_list)
else:
break
todo_file.close()
print_todo()