can anyone tell me what's wrong with my code?i am a beginner ,tried a lot but not able to find the bug | Sololearn: Learn to code for FREE!

0

can anyone tell me what's wrong with my code?i am a beginner ,tried a lot but not able to find the bug

4/24/2021 1:50:15 PM

Rajshree Mishra

6 Answers

New Answer

+5

Be careful with your indentation. Use 4 spaces for each level of indent. Your if and elifs should line up. There is no "&&" in Python. Just use "and".

+3

When asking for help, try to add as much information as possible to make it easier to understand the problem: what have you tried, whats the expected result, what are the errors you are getting, etc. From what I can see, I think there is an error with your if elif, they should all be aligned with the first if. I hope this helps

+1

print('bmi code') height = float(input("enter your height in cm :")) weight = float(input("enter your weight in kg :")) bmi = float(weight / (height*height)) if bmi < 18.5: print("underweight") elif bmi>=18.5 && bmi<25: print ("normal") elif bmi>=25 && bmi<30: print ("overweight") elif bmi>=30: print ("obesity") else : print("error in your syntax")

+1

thanks a lot sir i will try

+1

thanks to all prblm solved

0

Maintain proper indentation and use : after elif.