I am trying to print out the number of people in each category of my BMI calculator. Receiving error: > overweight, underweight, normal, obese = 0 TypeError: cannot unpack non-iterable int object
recipients = ["John", "Dee", "Aleister", "Lilith", "Paul", "Reggy"]
BMI_calc = []
def BMI(weights, heights):
bmi_total = (weights * 703) / (heights ** 2)
return bmi_total
def check(BMI):
if BMI <= 18.5:
print("Your underweight.")
elif BMI > 18.5 and BMI < 24.9:
print("You're normal weight.")
elif BMI > 25 and BMI < 29.9:
print("You're overweight.")
elif BMI > 30:
print("You're obese.")
for recipient in recipients:
heights_ = int(input("What is your height " + recipient + " :" ))
weights_ = int(input("What is your weight " + recipient + " :" ))
BMI_info={"name":recipient,"weight":weights_,"height":heights_,"BMI":BMI(weights_, heights_)}
BMI(BMI_info["weight"],BMI_info["height"])
BMI_calc.append(BMI_info)
for person_info in BMI_calc:
print(person_info["name"],end="\t")
check(person_info["BMI"])
overweight, underweight, normal, obese = 0
def check(BMI):
if BMI <= 18.5:
print("Your underweight.")
underweight += 1
elif BMI > 18.5 and BMI < 24.9:
print("You're normal weight.")
normal += 1
elif BMI > 25 and BMI < 29.9:
print("You're overweight.")
overweight +=1
elif BMI > 30:
print("You're obese.")
obese += 1
print("This many people are" ,underweight)
I am trying to print out "This many people are underweight with the value of individuals it that category same for over, normal and obese.