Question: Complete the following function in python based on the customers request. Function : def bmi(weight,height): #Add your code here Customers Request: take in two parameters

Complete the following function in python based on the customers request.

Function:

def bmi(weight,height): #Add your code here

Customers Request:

take in two parameters assumed to be weight in pounds and height in inches IN THAT ORDER

validate that both values are positive integers:

if not than you should return None

if both parameters are valid than you should calculate the bmi as instructed in PA#2 and return this value.

So that everyone gets the EXACT same results you should use 0.0254 as your height conversion factor and 0.453592 as your weight conversion factor.

For example:

bmi(150,66) will return 24.2104...

bmi(150,0) will return None

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!