# RETURN Mini Project — BMI Calculator
# return connects functions — output of one becomes input of another

# ─────────────────────────────────────────────
# Functions
# ─────────────────────────────────────────────

def calculate_bmi(weight, height):
    return weight / height ** 2

def get_category(bmi):
    if bmi < 18.5:
        return "Underweight"
    elif bmi < 25:
        return "Normal weight"
    elif bmi < 30:
        return "Overweight"
    else:
        return "Obese"

def print_bmi(weight, height):
    bmi = calculate_bmi(weight, height)
    category = get_category(bmi)
    print(f"Weight: {weight}kg | Height: {height}m | BMI: {bmi:.1f} | {category}")

# ─────────────────────────────────────────────
# Call it
# ─────────────────────────────────────────────

print_bmi(70, 1.75)
print_bmi(90, 1.80)
print_bmi(55, 1.60)

# Weight: 70kg | Height: 1.75m | BMI: 22.9 | Normal weight
# Weight: 90kg | Height: 1.80m | BMI: 27.8 | Overweight
# Weight: 55kg | Height: 1.60m | BMI: 21.5 | Normal weight

# ─────────────────────────────────────────────
# Use functions independently
# ─────────────────────────────────────────────

bmi = calculate_bmi(70, 1.75)
print(bmi)                    # 22.857...
print(f"{bmi:.1f}")           # 22.9
print(get_category(bmi))      # Normal weight

# ─────────────────────────────────────────────
# Go further
# ─────────────────────────────────────────────

# Add name parameter to print_bmi() — print "Bull | BMI: 22.9"
# Call calculate_bmi() and get_category() separately
# Add is_healthy(bmi) — returns True if BMI is between 18.5 and 24.9
