Professional Documents
Culture Documents
Writeup HealthTracker
Writeup HealthTracker
print("---Workout Input---")
lines = []
while True:
line = input()
if line:
lines.append(line)
else:
break
#print(lines)
print("---Output---")
#bmi calculation
bmi = weight / (height/100)**2
print("Your BMI is",round(bmi,2))
if bmi < 18.5:
print("Try to put on some weight")
elif bmi < 24.9:
print("You are good")
elif bmi < 29.9:
print("Try to reduce some weight")
else:
print("You should try to reduce your weight")
#acheivement calculation
print("Your acheivement is as follows:")
n = len(lines)
if n==7:
list = []
count = 0
for i in lines:
list = i.split(',')
if int(list[1]) != 0:
count = count + 1
if count == 7:
print("No breakouts in session: You get a 7/7 award")
else :
list = []
weeknumber = []
count = 0
weeklyaward = 0
monthlyaward = 0
for i in lines:
list = i.split(',')
if int(list[1]) != 0:
count = count + 1
if int(list[0]) == 7:
if count == 7:
weeklyaward = weeklyaward + 1
weeknumber.append(1)
else:
weeknumber.append(0)
count = 0
for i in range(0,int(n/7),4):
if weeknumber[i] == 1 and weeknumber[i+1] == 1 and weeknumber[i+2] == 1 and
weeknumber[i+3] == 1:
monthlyaward = monthlyaward + 1
print("You get ",weeklyaward," 7/7 award")
if n > 7:
print("You get ",monthlyaward," M/M award")