-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtodo.py
More file actions
41 lines (33 loc) · 755 Bytes
/
todo.py
File metadata and controls
41 lines (33 loc) · 755 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
33
34
35
36
37
38
39
40
41
tasks=[]
def add_task():
t=input("Enter the task: ")
tasks.append(t)
def show_task():
n=1
print("Tasks: ")
for i in tasks:
print(n,".",i)
n=n+1
def delete_task():
de = input("Enter the task that has to be deleted: ")
if de in tasks:
tasks.remove(de)
else:
print("Task doesn't exist")
while(True):
print("1.Add task\n")
print("2.Show task\n")
print("3.Delete task\n")
print("4.Exit")
ch=int(input("Enter the choice: "))
if ch==1:
add_task()
elif ch==2:
show_task()
elif ch==3:
delete_task()
elif ch==4:
print("Bye!")
break
else:
print("Invalid choice")