Help me to carecter this python code | Sololearn: Learn to code for FREE!

+1

Help me to carecter this python code

weight = int(input("enter your weight :")) height = float(input("enter your height :")) ans = float(weight/(height ** 2)) if(ans < 18.5): print("Underweight") elif (ans == 18.5 && ans < 25): print("Normal") elif (and == 25 && ans < 30): print("Overweight") elif (ans >= 30) print("Obesity")

5/24/2022 9:56:07 AM

RTB

2 Answers

New Answer

+8

RTB Python does not use && Python does use and

+6

RTB , -> check your code for correct indentation -> check for missing colon after 'elif: -> also check all conditiins like '... ans == 18.5...'. (comparison operator). read the task description carefully and follow it btw: -> we do not need parenthesis when using 'if' or 'elif' -> if you are going to use your code for code coach, no user prompt in input() function is accepted