can someone tell me what's wrong with this code | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

can someone tell me what's wrong with this code

https://code.sololearn.com/c18jnzaEIyvy/?ref=app

14th Aug 2021, 3:55 PM
Zelda
Zelda - avatar
2 Respuestas
+ 4
Hi Zelda! Your logic is correct. But you have to avoid additional things in your outputs of your code. Always remember, your program is accepted by Sololearn if your output is the same as expected. And also you have some typos too. Here it is your working code. 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') elif bmi > 30: print('Obesity')
14th Aug 2021, 4:33 PM
Python Learner
Python Learner - avatar
0
JUMP_LINK__&&__Python__&&__JUMP_LINK Learner You can avoid the chained operators by going from the top to the bottom; from 30 to 18.5
14th Aug 2021, 5:12 PM
Calvin Thomas
Calvin Thomas - avatar