forked from AmI-2018/python-lab2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEx1.py
More file actions
34 lines (32 loc) · 744 Bytes
/
Ex1.py
File metadata and controls
34 lines (32 loc) · 744 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
i = 0
task = []
exit_status = 0
while exit_status == 0:
print("To-do Manager:")
print("1. Insert new task")
print("2. Remove task")
print("3. Show all tasks")
print("4. Exit")
choice = int(input())
if choice == 1 :
print("Insert name: ")
name = input()
task.append(name)
i += 1
elif choice == 2 :
print("Insert name: ")
name = input()
if name not in task:
print("Not found")
else:
task.remove(name)
i -= 1
elif choice == 3 :
a = 1
for x in sorted(task):
print(str(a)+")",x)
a+=1
elif choice == 4:
exit_status = 1
else:
print("Wrong number!")