-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhabit_tracker.py
More file actions
45 lines (43 loc) · 1.12 KB
/
habit_tracker.py
File metadata and controls
45 lines (43 loc) · 1.12 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
print("made by hiral ")
print("1.add habit")
print("2.view all habits")
print("3.mark habit as completed")
print("4.delete habit")
print("5.exit")
print("6.view completed habits")
habit=[]
done=[]
while True:
a=int(input("enter the option you want to select"))
if(a==1):
print("add habit")
y=input("enter your habit")
habit.append(y)
print("habit is added")
elif(a==2):
print("view all habits")
print(habit)
elif(a==3):
print("mark habit as completed")
print(habit)
ask=int(input("which habit is completed"))
if(ask>0 and ask<=len(habit)):
done.append(habit[ask-1])
print("habit competed")
else:
print("invalid")
elif(a==4):
print("delete option")
f=int(input("enter the habit you want to delete"))
if(f>0 and f<=len(habit)):
habit.remove(habit[f-1])
else:
print("wrong")
elif(a==5):
print("exit")
break;
elif(a==6):
print("view habit is completed")
print(done)
else:
print("wrong option")