Question: Draw my python code to a flowchart fileName = weightHeight.txt file = open(fileName,'r') line = file.readline() for line in file : line= line.strip() # print(line)
Draw my python code to a flowchart
fileName = "weightHeight.txt" file = open(fileName,'r')
line = file.readline() for line in file : line= line.strip() # print(line) columns=line.split() gender = columns[0] height = float(columns[1]) weight = float(columns[2]) def height_convert (Inch): return Inch/39.37 height_in_meter = height_convert (height) def weight_convert (Lbs): return (0.4536*Lbs) weight_in_KG = weight_convert(weight) def bmi (): return weight_in_KG / (height_in_meter**2) bmi = bmi () def BMI_category (): if bmi<18.5: category = "Under weight" elif bmi<25: category = "Normal weight" elif bmi<30: category = "Over weight" else: category = "Obese " return category BMI = BMI_category () print("Gender:",gender,"<>Height:",str(height),"<>Weight:",str(weight),"<>BMI:",str(bmi),"<>Category:",BMI," ",'-'*40)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
