Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What do I need to tweak my function to make sure it runs correctly? Python help Question 2: Finding Body Mass Index (3 points) Body

image text in transcribedWhat do I need to tweak my function to make sure it runs correctly? Python help

Question 2: Finding Body Mass Index (3 points) Body mass index (BMI) is a value derived from the mass and height of a person. The BMI is defined as the body mass divided by the square of the body height, and is commonly expressed in units of kg/m. The BMI is a convenient rule of thumb used to broadly categorize a person as underweight, normal weight, overweight, or obese based on tissue mass (muscle, fat, and bone) and height. This categorization is often debated an generally viewed as reasonable for population studies and inappropriate for invidual evaluation. In a mini study, data was collected on 8 subjects in Spain with the measurements in order for each subject of: weights = [70, 75, 60, 30, 65, 80, 85, 100] kilograms (kg) heights = [1.7, 1.8, 1.5, 1.42, 1.75, 1.8,1.85, 1.650 meters (m) In other words, the first subject has a weight of 70 kg and a height of 1.7 m. Q2.1: Print the BMI of these 8 subjects Make a list of the weights and a list of the heights, then loop through the lists to c subject in a sentence. For example, the BMI of subject 1 is 24.2 kg/m2. BMI of subject 2 is 23.1 kg/m2. (feel free to look up the equation for BMI to determine the math necessary) # Write your solution to question 2.1 in this cell weight = [70, 75, 60, 30, 65, 80, 85, 100] height = [1.7, 1.8, 1.5, 1.42, 1.75, 1.8,1.85, 1.65] # formula weight/ height^2 import numpy as np def bmi (weight = np.array([70, 75, 60, 30, 65, 80, 85, 100]), height = np.array([1.7, 1.8, 1.5, 1.42, 1.75, 1.8,1.85, 1.65])): bmi_calc = [] for x in weights: calculate_bmi.append = weight/(height * height) return (calculate_bmi) new_bmi = bmi(weight, height) print(new_bmi)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions

Question

f. Did they change their names? For what reasons?

Answered: 1 week ago