Home > database >  No function output
No function output

Time:05-03

trying to run a simple calculator in python. There is no error codes that pop up, yet there is no output. If anyone can help that would be great

Code below

def BMR_calc(gender, weight, height, age):
  if gender == 0:
      return (66.47  (6.24*weight) (12.7*height)-(6.76*age))
  elif gender == 1:
      return ((4.54*weight)  (15.88*height)-(5*age)-161)

aBMR = BMR_calc(0, 250, 65, 30)

CodePudding user response:

You are assigning the result for variable aBMR You must print it to see the result

print(BMR_calc(0, 250, 65, 30))

enter image description here

CodePudding user response:

Just like what @Tim Roberts and @DrakeLiam said. Add a print statement at the end!

    def BMR_calc(gender, weight, height, age):
        if gender == 0:
            return (66.47  (6.24*weight) (12.7*height)-(6.76*age))
        elif gender == 1:
            return ((4.54*weight)  (15.88*height)-(5*age)-161)

    aBMR = BMR_calc(0, 250, 65, 30)
    print(aBMR)
  • Related