Write a program that prompts the user to enter their weight (in kilograms) and height (in meters). The program should calculate the Body Mass Index (BMI) using the formula:
BMI = weight / (height * height).
The program should then classify the BMI into one of the following categories:
Underweight: BMI less than 18.5
Normal weight: BMI between 18.5 and 24.9
Overweight: BMI between 25 and 29.9
Obesity: BMI 30 or greater

Source Code

# Prompt the user to enter their weight and height
weight = float(input("Enter your weight in kilograms: "))
height = float(input("Enter your height in meters: "))

# Calculate the BMI
BMI = weight / (height * height)

# Classify the BMI
if BMI < 18.5:
    print("Category: Underweight")
elif BMI <= 24.9:
    print("Category: Normal weight")
elif BMI <= 29.9:
    print("Category: Overweight")
else:
    print("Category: Obesity")

Output

Enter your weight in kilograms: 65
Enter your height in meters: 1.65
Category: Normal weight