- 1
What does the "for" loop do?
w = int(input()) h = float(input()) bmi = w/(h**2) dic = { "Underweight" : lambda v: v < 18.5, "Normal" : lambda v: 18.5 <= v < 25, "Overweight" : lambda v: 25 <= v < 30, "Obesity" : lambda v: 30 <= v < 100, } for res in dic: if dic[res](bmi): print(res) break
3 Answers