What’s the problem? (BMI Calculator) [Fixed] | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What’s the problem? (BMI Calculator) [Fixed]

import math Height=float(input()) Weight=float(input()) BMI=Weight//math.pow(Height,2) if BMI > 30: print('Obesity') elif BMI > 25: print('Overweight') elif BMI > 18.5: print('Normal') else: print('Underweight') Output: Underweight (Always)

20th Nov 2022, 8:53 AM
Alex Madsen
3 Answers
+ 3
Description says: First input is weight and second input is for height.
20th Nov 2022, 8:58 AM
Jayakrishna 🇮🇳
+ 3
Check the formula for bmi again and compare "/" vs. "//".
20th Nov 2022, 8:58 AM
Lisa
Lisa - avatar
+ 2
Thank you! The problem was that the input order was reversed.
20th Nov 2022, 9:23 AM
Alex Madsen