+ 1
Is there anything wrong with this BMI calculator? (SOLVED)
i'm a begginer and i've done the BMI Calculator project, i passed it but when i tried it somewhere else it didn't work. Can you please tell whats the problem with the code? weight = float(input()) height = float(input()) BMI = weight / (height ** 2) if BMI < 18.5: print("Underweight") if BMI >= 18.5 and BMI < 25: print("Normal") if BMI >= 25 and BMI < 30: print("Overweight") if BMI >= 30: print("Obesity") Thanks
4 Respostas
+ 3
Looks just fine to me, doesn't look like the compiler on Sololearn is user friendly, change your weight and height to actual values and try again
+ 2
Elijah
Sometimes when you copy / paste across different platforms, you get some weird results.
Try writing the code directly into your 3rd party platform
+ 2
Hi Elijah!
If you tried this on Sololearn code playground, you have to provide both inputs at a same time on that alert box. Both inputs should be separated in a new line and hit the submit.
For example,
60
1.80
+ 2
Thank you all