Testing Code Blocks

Testing Code Highlighting

Here's a Python code example:

def calculate_bmi(weight, height):
    """
    Calculate BMI given weight in kg and height in meters.
    """
    bmi = weight / (height ** 2)

    if bmi < 18.5:
        return f"BMI: {bmi:.1f} - Underweight"
    elif bmi < 25:
        return f"BMI: {bmi:.1f} - Normal weight"
    elif bmi < 30:
        return f"BMI: {bmi:.1f} - Overweight"
    else:
        return f"BMI: {bmi:.1f} - Obese"

# Example usage
weight = 70  # kg
height = 1.75  # meters
print(calculate_bmi(weight, height))