0

weight= int(input()) height=int(input()) BMI=weight/height*height if BMI<18.5: print("Underweight") elif BMI >=18.5 and <25: p

plz explain where is the bug

26th Feb 2021, 12:07 PM
Downey Dewy
Downey Dewy - avatar
10 ответов
+ 4
Edit your question, you will see + icon on the left hand side from there you can add code or post! Happy Coding 😌
26th Feb 2021, 12:12 PM
Sharique Khan
Sharique Khan - avatar
+ 3
28th Feb 2021, 3:01 AM
Sharique Khan
Sharique Khan - avatar
+ 2
Please post your code as a code not text so that other users can work on it and give you a solution. 🤟🏻
26th Feb 2021, 12:09 PM
Sharique Khan
Sharique Khan - avatar
+ 2
btw here is the correction weight = int(input()) height = float(input()) res = weight / height**2 if res < 18.5: print("Underweight") elif res >= 18.5 and res < 25: print("Normal") elif res >= 25 and res < 30: print("Overweight") elif res >= 30: print("Obesity") height should be float and do give the spaces (indents) properly
26th Feb 2021, 12:11 PM
Sharique Khan
Sharique Khan - avatar
+ 2
#Sharique Khan for your valuable information
26th Feb 2021, 1:21 PM
Downey Dewy
Downey Dewy - avatar
+ 1
I don't know how post as code🙄
26th Feb 2021, 12:11 PM
Downey Dewy
Downey Dewy - avatar
+ 1
damn, don't put your code on the title of your question.
26th Feb 2021, 12:23 PM
Rellot's screwdriver
Rellot's screwdriver - avatar
+ 1
Coding Kitty[exams] I don't know how to post my question, just posted question😁🤗
26th Feb 2021, 1:18 PM
Downey Dewy
Downey Dewy - avatar
+ 1
I think this code can help you. weight=int(input()) height=float(input()) IBM=weight/(height)**2 height==0 while True: break if IBM<18.5: print("Underweight") elif 18.5<=IBM and IBM<25: print("Normal") elif IBM>=25 and IBM<30: print("Overweight") else: print("Obesity")
27th Feb 2021, 10:45 PM
Thomas Sentre
Thomas Sentre - avatar
+ 1
The problem is that the expression after your "and" lacks a relation. So it only says smaller than 25. But it is not stated what should be smaller than 25. You can skip the "and" totally by writing 18.5 <=bmi <25:
27th Feb 2021, 10:56 PM
StephBill
StephBill - avatar