+ 1
Help pls i don't know what is the problem
Weight=input() height=input() X=int(Weight)/int(height)**2 if X<18.5: print("Underweight") if 18.5<=X<25: print("Normal") if 25<=X<30: print("Overweight") if 30<=X: print("Obesity")
5 Answers
+ 2
Ryad ĂhmĂ©d
Convert inputs to float not int
+ 5
Ryad ĂhmĂ©d ,
this seems to be a in-lesson code coach. if you really have a problem, we need some more details from you:
âȘïžgive a clear and complete description about your task
âȘïžif there are error messages please post them here
thanks for your understanding!
+ 4
Ryad ĂhmĂ©d ,
the input of the height value can be like 1.9 (1 meter and 90 cm). if you convert this to int the result will be 1. it will also be 1 if input is 1.5.
+ 2
It worked but why float not int? AÍąJ - SÍoÍlÍoÍHÍeÍlÍpÍeÍrÍ
+ 1
Ryad ĂhmĂ©d
Because height is in decimal so when you take input in python then your input is by default String like '1.85' so you can't convert in int
Try this in Code Playground:
print(int('1.95'))