Question
PYTHON LANGUAGE In Lab 2, you wrote a script that computed bmi risk. Convert that code to a function called bmiRisk that takes two parameters
PYTHON LANGUAGE In Lab 2, you wrote a script that computed bmi risk. Convert that code to a function called bmiRisk that takes two parameters bmi and age (in that order) and returns the string High, Medium, Low based on the table below.
Under 45 | 45 or over | |
---|---|---|
BMI less than 22 | Low | Medium |
BMI 22 or more | Medium | High |
Age= float(input("how old are you?")) BMI=float(input("what is your body mass index?")) if Age>=45 and BMI<=22: print("Medium") elif Age>=45 and BMI>=22: print("High") elif Age<=45 and BMI<=22: print("Low") elif Age<=45 and BMI>=22: print("Medium")
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started