-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path6_ToDoList.py
More file actions
88 lines (67 loc) · 3.31 KB
/
Copy path6_ToDoList.py
File metadata and controls
88 lines (67 loc) · 3.31 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#project6
#ToDo List App
#Introduction:
print("Welcome Here!!")
print("--- TO-DO LIST APP ---")
print("1. Add a Task")
print("2. View Tasks")
print("3. Mark Task Complete")
print("4.view the completed task")
print("5.Delete task")
print("6. Exit")
task = []
completed=[]
def taskOnly():
count = 1
for eachtask in task:
print(f"{count}.{eachtask}")
count= count+1
def completedOnly():
count = 1
for i in range(len(completed)):
if completed[marked-1]==completed[i]:
print(count, completed[i],"✅")
else:
print(count,completed[i],"❌")
count = count +1
#loopingg
while True:
user = int(input("choose an option from above(numbers Only):"))
if user==1:#add
choice1= print("add the task you want:").lower()
task.append(choice1)
completed.append(choice1)
print("your task added succesfully🤗")
elif user==2:#
if len(task)==0:
print("No task added😩.")
else:
print(taskOnly())
elif user == 3:#mark
print(taskOnly())
marked = int(input("Choose the task you completed(numbers only):"))
if marked == task[marked-1]:
print(marked,completed[marked-1],"✅")
print("Great Work On That!!✨🤗")
else:
print("sorry wrong option🤨!!!!")
elif user == 4:#view marked
print(completedOnly())
elif user == 5:#delete
if len(task)==0:
print("sorry there isn't any task😌")
else:
choice4 = input("do you want to clear everything(yes or no):").lower()
if choice4 == "yes":
task.clear()
print("cleared eveything 🚽")
else:
print(taskOnly())
delete = int(input("choose the task you want to remove:"))
task.remove(task[delete-1])
print(f"{delete}.{task[delete-1]} deleted succesfully.")
elif user== 6:
print("bye bye")
break
else:
print("sorry invalid request.")