BMI and Karvonen Calculator python

Viewed 52

https://softchalkcloud.com/lesson/serve/njUvRZqCb1mDIH/html

This is the project I am working and am nowhere near finishing it. I keep getting this output for a weight conversion calc, lbs to kg function weight_in_kg at 0x000002028E06BAC0 and i don't know why

def weight_in_kg(lbs):
    wieght_in_kg = lbs * 0.45359237
    return weight_in_kg

def height_meters(inches):
    height_meters = inches / 39.3700787
    return height_meters

def height_square_meters(meters):
    height_sqaure_meters = meters ** 2
    return height_square_meters

def get_weight(prompt):
    weight_in_pounds = input(prompt)
    while not weight_in_pounds.isdigit():
        print('Please enter an integer ')
        weight_in_pounds = input('Try and enter your weight in pounds again')
    weight_in_pounds = int(weight_in_pounds)
    return weight_in_pounds

def get_height(prompt):
    height_inches = input(prompt)
    while not height_inches.isdigit():
        print('Please enter and integer ')
        height_inches = input('Try and enter your height in inches again')
    height_inches = int(height_inches)
    return height_inches


patient_weight_pounds = get_weight('Enter your weight in pounds ')
patient_weight_kg = weight_in_kg(patient_weight_pounds)

print(patient_weight_kg)

test = weight_in_kg(100)
print(test)
1 Answers

when you modify your weight_in_kg function, you will receive the right output. I think your problem was that you returned the memory address of the function, not the result.

def weight_in_kg(lbs):
    weight_in_kgs = lbs * 0.45359237
    return weight_in_kgs
Related