Thread replies: 5
Thread images: 1
Anonymous
Python Program
2016-03-17 22:37:56 Post No. 81416
[Report]
Image search:
[Google]
Python Program
Anonymous
2016-03-17 22:37:56
Post No. 81416
[Report]
Any python programmers out there wanna take a look at my code and see why it isn't working
def vo2max_resting(age, resting_pulse):
""" takes age in years and resting pulse in beats per minute"""
return 15.3 * (208 - 0.7 * age) / resting_pulse
def vo2max_step_3min(gender, pulse):
"""returns pulse according to the 3 minute step test"""
if gender is "m":
return 111.33 - (0.42 * pulse)
elif gender is "f":
return 65.81 - (0.1847 * pulse)
else:
return -1
"""program that returns vo2max after input from users"""
def main():
"""returns vo2max after user input"""
name_string = input("Enter given name: ")
name = str(name_string.capitalize())
family_name_string = input("Enter family name: ")
family_name = str(family_name_string.upper())
gender_string = input("Enter gender (m/f): ")
gender = str(gender_string)
age_string = input("Enter age (in years): ")
age = int(age_string)
resting_string = input("Enter resting heart rate (bpm): ")
resting = int(resting_string)
step_test_string = input("Enter pulse after 3min step test: ")
step_test = int(step_test_string)
if gender is "m":
print("----------------------------------------")
print("Results for: " + family_name + "," + " " + name)
print('vo2max from resting pulse =')
main()
test_age = 29
test_pulse = 100
result = vo2max_resting(test_age, test_pulse)
print('{:.2f}'.format(result))