-
Notifications
You must be signed in to change notification settings - Fork 0
/
gym_m_s_by fun.py
78 lines (72 loc) · 2.36 KB
/
gym_m_s_by fun.py
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
def lock():
in2 = int(input("What do you want to edit?\nPress\n1.Exercise\n2.Diet\n"))
in3 = int(input("Whom do you want to edit?\nPress\n1. Harry\n2. Rohan\n3. Rahul\n"))
if in3 == 1 and in2 == 1:
with open("harryex.txt", "r+") as a:
in4 = input("Enter exercise:\n")
a.write(in4)
elif in3 == 1 and in2 == 2:
with open("harryd.txt", "r+") as b:
in5 = input("Enter diet:\n")
b.write(in5)
elif in3 == 2 and in2 == 1:
with open("rohanex.txt", "r+") as b:
in5 = input("Enter exercise:\n")
b.write(in5)
elif in3 == 2 and in2 == 2:
with open("rohand.txt", "r+") as b:
in5 = input("Enter diet:\n")
b.write(in5)
elif in3 == 3 and in2 == 1:
with open("rahulex.txt", "r+") as b:
in5 = input("Enter exercise:\n")
b.write(in5)
elif in3 == 3 and in2 == 2:
with open("rahuld.txt", "r+") as b:
in5 = input("Enter diet:\n")
b.write(in5)
def retrieve():
in2=int(input("What do you want to edit?\nPress\n1.Exercise\n2.Diet\n"))
in6=int(input("Whom do you want to edit?\nPress\n1. Harry\n2. Rohan\n3. Rahul\n"))
if in6 == 1 and in2 == 1:
with open("harryex.txt") as x:
y = x.read()
print(y)
elif in6 == 1 and in2 == 2:
with open("harryd.txt") as x:
y = x.read()
print(y)
elif in6 == 2 and in2 == 1:
with open("rohanex.txt") as x:
y = x.read()
print(y)
elif in6 == 2 and in2 == 2:
with open("rohand.txt") as x:
y = x.read()
print(y)
elif in6 == 3 and in2 == 1:
with open("rahulex.txt") as x:
y = x.read()
print(y)
elif in6 == 3 and in2 == 2:
with open("rahuld.txt") as x:
y = x.read()
print(y)
def start():
in1=input("Hello Boss, what you want to do?\nPress \nL for log\nR for retrieve\n")
if in1=='L' or in1=='l':
lock()
elif in1=='R' or in1=='r':
retrieve()
else :
print("You have entered invalid input")
exit()
start()
in7=int(input("Do you want to repeat?\n Press\n1.Yes\n2.No\n"))
if in7==1:
in8=1
while(in8<2):
start()
in8=int(input("Do you want to repeat?\n Press\n1.Yes\n2.No\n"))
else:
exit()