11 Answers
New AnswerYour code seems to have a lots of errors weight = float(input()) Same with height height = float(input()) Put the height**2 in parentheses like this: (height**2) edit: sorry for the parentheses correction, I am only wrong 😕😅
∆BH∆Y is right (except you don't need parentheses around height**2 because exponentiation is evaluated before division)
not everything is capslock: question title and tag are not... so you don't have any excuse for that... (and even all caps, that's not a good excuse at all... how could you code if you have capslock blocked ^^)
George You just have to add the same variable to second condition after the 'and'. For Example: 🔹elif bmi >= 18.5 and < 25: # Should Be 🔹elif bmi >= 18.5 and bmi < 25: ________________________________ weight = int(input()) height = float(input()) bmi = weight / height**2 if bmi < 18.5: print("Underweight") elif bmi >= 18.5 and bmi < 25: primt("Normal") elif bmi >= 25 and bmi < 30: print("Overweight") else bmi >= 30: print("Obesity") ________________________________
ok weight = input(int()) height = input(float()) bmi = weight / height**2 if bmi < 18.5: print("Underweight") elif bmi >= 18.5 and < 25: primt("Normal") elif bmi >= 25 and < 30: print("Overweight") else bmi >= 30: print("Obesity")
Help the python ?? No one likes homework, but your math teacher has given you an assignment to find the sum of the first N numbers. Let’s save some time by creating a program to do the calculation for you! Take a number N as input and output the sum of all numbers from 1 to N (including N). Sample Input 100 Sample Output 5050 Explanation: The sum of all numbers from 1 to 100 is equal to 5050