Help for construct a code | Sololearn: Learn to code for FREE!


Help for construct a code

BMI calculator

4/11/2021 1:47:38 PM

vijayalakshmi T.G.

5 Answers

New Answer

+2 Here is your code. You had some basic errors in your code


What are those errors i am not able to identify


=> You had used "Print" instead of "print" => In python you need to add whitespace at the beginning of the block of code which you had missed You can read about python indentation here,indicate%20a%20block%20of%20code.


hieght=float (input ("Enter hieght in m:")) Weight =(input (Enter weight in kg:")) bmi=weight/(hieght*hieght ) Print (f"bmi is {bmi}") if (bmi <18.5): Print ("under weight ") elif (18.5 <bmi and bmi <25): Print ("normal") elif (25 <bmi and bmi <30): Print("over weight ") elif (bmi >30): Print("obesity") It is my code but it shows error as expect intended block


weight = int(input()) height = float(input()) BMI = (weight / (height**2)) if BMI < 18.5: print("Underweight") elif (25 > BMI): print("Normal") elif (30 > BMI): print("Overweight") elif BMI >= 30: print("Obesity") it is nice and clean code i write ๐Ÿ‘Œ