I am trying to make a code that calculates the BMI of individuals that the user inputs. Here is where I am stuck, using a second loop the program should traverse the array of body mass indices and call another function that accepts the body mass index(BMI) as a parameter and returns whether the individual is underweight, normal weight or overweight, finally I want to count number of individuals in each category. I keep getting an error typeerror: ‘>’ not supported between instances of ‘str’ and ‘int’ Solution. Honestly I don't even know if I'm doing it right at all to get the out put I want. Thank you for any help.
Below if what I've got:
individuals = list()
for i in range((int(input("Please enter the number of individuals you would like calculate BMIs for:")))):
user = str(input("Please enter the names of the individuals one at a time: "))
individuals.append(user)
BMIs = []
for user in individuals:
print("Input for", user)
height = int(input(user + ", in inches, how tall are they? "))
weight = int(input(user + ", in pounds, how much do they weigh? "))
BMIs.append(user + "s, BMI is: " + str(weight * 703/height**2))
for BMI in BMIs:
if ( BMI <18.5):
print(BMI, "underweight")
elif ( BMI >= 18.5 and BMI < 30):
print(BMI,"normal")
elif ( BMI >=30):
print(BMI,"severely overweight")