0

Hello!I am a beginner in python.I am making bmi calculator.result of the project is same but it is showing wrong.pls help

weight = float(input("enter your weight:")) height = float(input("enter your height:")) bmi = weight / (height ** 2) if bmi < 18.5: print('underweight') elif bmi >= 18.5 and bmi < 25: print('normal') elif bmi >= 25 and bmi < 30: print('overweight') elif bmi == 30 or bmi > 30: print('obesty') This is the code that I write

24th Mar 2021, 5:10 AM
Coderado
Coderado - avatar
4 ответов
+ 2
'underweight', 'normal' and other strings to print must start with the capital letter in this case (for example, 'Underweight' instead of 'underweight'). Explanation: lowercase and uppercase letters are different characters/code points in ASCII (and thus in the most of modern and standard as they based off of ASCII) text encodings.
24th Mar 2021, 6:57 AM
#0009e7 [get]
#0009e7 [get] - avatar
+ 2
visph, I already re-formulated the sentence to "sound" right (as of my opinion). And it is not always thus. For example, ASCII of 1963 year: https://en.m.wikipedia.org/wiki/ASCII#History . Also, maybe, some unpopular, especially indie and experimental (I am pretty sure they exist).
24th Mar 2021, 7:03 AM
#0009e7 [get]
#0009e7 [get] - avatar
+ 1
get in old encoding also :D
24th Mar 2021, 6:59 AM
visph
visph - avatar
+ 1
most likely caps issue, the first letters of the printed words are capital
25th Mar 2021, 4:13 PM
ahdeyy
ahdeyy - avatar