+ 3
simple BMI calculator making by Python
I'm new here. I'm trying to learn python as well.so trying to harder I made a BMI calculator just simple.need your comment how was this?is it right or wrong? is possible to make this code also easier? weight = float(input()) height = float(input()) BMI = weight / (height ** 2) if BMI < 18.5: print("Underweight") elif 18.5 <= BMI < 25: print("Normal") elif 25 <= BMI < 30: print("Overweight") else: print("Obesity") print("Finished")
3 odpowiedzi
+ 6
Md Abdur Rahman
Q: "Is it right or wrong?"
Have you tried it on the challenge itself? If it passed all the test cases then it's fine, if not, then the community will help.
Though I think that won't pass all test cases because of the last line that prints "Finished" which is not needed.
+ 3
Hi! you tried running this code in the "codes" section { }? where did you get it?
0
Hi! Nice codes you have written but the weight should be an integer not a float and you can do without the last statement.