Feb-24-2019, 08:42 PM
please explain to me following command lines. we created variable name1,then we def function bmi_calculator in that function we wrote three arguments. in which one is 'name' which is same used in if condition as name + "is not over weight". what i dont understand that how these two name1 and name are linked. because in the result variable we moved to the name1, height_m1.... can someone explain to me the following codes working concept. i cant understand the result "jobs is not overweight" is achieved. thanks
name1 = "jobs" height_m1 = 2 weight_kg1 = 90 def bmi_calculator(name, height_m, weight_kg): bmi = weight_kg / (height_m ** 2) if bmi < 25: return name + " is not overweight" else: return name + " is overweight" result = bmi_calculator(name1, height_m1, weight_kg1) print(result)result will come: jobs is not overweight