Hey guys !
I’ve been trying to solve the python control flow project, but each time I call my BMI function it doesn’t execute despite having no errors.
I’ve tried to run the code on VScode but it’s the same result.
Here’s the code :
# Add your code here def analyze_smoker(smoker_status): if smoker_status == 1: print("To lower your cost, you should consider quitting smoking.") else: print("Smoking is not an issue for you.") # BMI function def analyze_bmi(bmi_value): if bmi_value > 30: return "Your BMI is in the obese range. To lower your cost, you should significantly lower your BMI." elif bmi_value >= 25 and bmi_value <= 30: return "Your BMI is in the overweight range. To lower your cost, you should lower your BMI." elif bmi_value >= 18.5 and bmi_value < 25: return "Your BMI is in a healthy range." elif bmi_value >= 18.5: return "Your BMI is in the underweight range. Increasing your BMI will not help lower your cost, but it will help improve your health." # Function to estimate insurance cost: def estimate_insurance_cost(name, age, sex, bmi, num_of_children, smoker): estimated_cost = 250*age - 128*sex + 370*bmi + 425*num_of_children + 24000*smoker - 12500 print(name + "'s Estimated Insurance Cost: " + str(estimated_cost) + " dollars.") analyze_smoker(smoker) analyze_bmi(bmi) return estimated_cost # Estimate Keanu's insurance cost keanu_insurance_cost = estimate_insurance_cost(name = 'Keanu', age = 29, sex = 1, bmi = 26.2, num_of_children = 3, smoker = 1)
I only keep getting :
Keanu’s Estimated Insurance Cost: 29591.0 dollars.
To lower your cost, you should consider quitting smoking.
As you can see there is no execution of my BMI function.