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
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.
+ 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).
+ 1
get in old encoding also :D
+ 1
most likely caps issue, the first letters of the printed words are capital