# q8 – create function bodyMassIndex() to meet the conditions below…
Question Answered step-by-step # q8 – create function bodyMassIndex() to meet the conditions below… # q8 – create function bodyMassIndex() to meet the conditions below# – accept two lists and a filename to write to# # – The first list contains various weights in kg. The second list contains# various heights in meters. Find all the combination of different # weights and heights and calculate the BMI for each pair and write the# data to the texfile. ## BMI is kg per meters squared (kg/m^2) and is calculated by the following# formula: weight/height**2. Use the round() function to round the BMI# before writing it to the textfile## — Example lists:# weight list in kg = [35,50,55,60,70]# height list in meter = [1.5,1.6]# — Example out textfile:# 35 1.5 16# 35 1.6 14# 50 1.5 22# 50 1.6 20# 55 1.5 24# 55 1.6 21# 60 1.5 27# 60 1.6 23# 70 1.5 31# 70 1.6 27## put a space between weight, height, and the BMI values when writing them# into the textfile## returns a tuple with the count for underweight, normal and# overweight MBIs the exmaple thus will return (2, 5, 3)## – Note:# — underweight is MBI <= 18# --- normal is 18 < MBI <= 25# --- overweight is MBI > 25## – RESTRICTIONS: None## – DOCUMENTATION – Add a meaningful docstring to the function## – params: list# list# string# – return: tuple (int, int, int) Computer Science Engineering & Technology Python Programming CSC 131 Share QuestionEmailCopy link Comments (0)


