Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

health management program #1010

Merged
merged 1 commit into from
Oct 31, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Create health management program
Hope you like it
  • Loading branch information
Krishjain2004 committed Oct 27, 2020
commit 9255d24e60db633fea1af7ea6b0b443aa92e6ba3
137 changes: 137 additions & 0 deletions Python-programming-1/health management program
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# f = open("KrishDiet.txt","w")
# f.write("Hi Krish here is your diet")
# f.close()
# f = open("Krishexercise.txt","w")
# f.write("Hi Krish here is your exercise")
# f.close()
#
# f = open("SamirDiet.txt","w")
# f.write("Hi Samir here is your diet")
# f.close()
# f = open("Samirexercise.txt","w")
# f.write("Hi Samir here is your exercise")
# f.close()
#
# f = open("HarryDiet.txt","w")
# f.write("Hi harry here is your diet")
# f.close()
# f = open("Harryexercise.txt","w")
# f.write("Hi Harry here is your exercise")
# f.close()

def getdate():
import datetime
return datetime.datetime.now()


print("What do you want to add press 1 for exercise or press 2 for diet")
inp=int(input())



if inp==1:
print("what is your name")
inpname=input()
if inpname=="Krish":
print("What do you want to do add or read")
inpdo=input()

if inpdo=="add":
print("Now you can add")
d= open("Krishexercise.txt","a")
d.write(input("\n"))
print("successfully written")
elif inpdo=="read":

e=open("Krishexercise.txt")
print(e.read())
e.close()

if inpname=="Samir":
print("What do you want to do add or read")
inpdo = input()

if inpdo == "add":
print("Now you can add")
f = open("Samirexercise.txt","a")
f.write(input())
print("successfullywritten")

elif inpdo == "read":

g = open("Samirexercise.txt")
print(g.read())
g.close()


if inpname=="Harry":
print("What do you want to do add or read")
inpdo = input()

if inpdo == "add":
print("Now you can add")
h = open("Harryexercise.txt","a")
h.write(input())
print("successfully written")






elif inpdo == "read":

i = open("Harryexercise.txt")
print(i.read())
i.close()

elif inp==2:
print("what is your name")
inpname=input()
if inpname=="Krish":
print("What do you want to do add or read")
inpdo=input()

if inpdo=="add":
print("Now you can add")
j= open("KrishDiet.txt","a")
j.write(input())
print("successfully written")
elif inpdo == "read":

h = open("KrishDiet.txt")
print(h.read())
h.close()

if inpname=="Samir":
print("What do you want to do add or read")
inpdo = input()

if inpdo == "add":
print("Now you can add")
i = open("SamirDiet.txt","a")
i.write(input())
print("successfully written")
elif inpdo == "read":

j = open("SamirDiet.txt.txt")
print(j.read())
j.close()

if inpname=="Harry":
print("What do you want to do add or read")
inpdo = input()

if inpdo == "add":
print("Now you can add")
k = open("HarryDiet.txt","a")
k.write(input())
print("successfully written")
elif inpdo == "read":

l = open("HarryDiet.txt")
print(l.read())
l.close()
else:
print("Error")
print("please try again")