0
Hello guys, I just want to see, how you did solve the task from python for beginners BMI Calculator.
Hello guys, I'm new to here and just started learning programming. As you can see in question string I'm learning python. There was a quiz to create the program to calculate BMI by entering your height and weight. I've solved it already, but want to see other ver of solving this quiz. Could be kind plz to show me your versions of making BMI Calculator https://code.sololearn.com/cCdSqJkxsH70/?ref=app
7 Respuestas
+ 3
First can you show your version??
+ 2
# my solution
weight = int(input())
height = float(input())
bmi = weight / height ** 2
if bmi < 18.5:
print("Underweight")
elif 25 > bmi >= 18.5:
print("Normal")
elif 30 > bmi >= 25:
print("Overweight")
elif bmi > 30:
print("Obesity")
+ 2
edit:
Max Tumarbek
here is possible other approaches
sum = weight//(height**2) #i think you need / instead of // for fraction value. may it coincidence passing all.
if sum < 18.5:
print("Underweight")
elif sum <= 25: #you can go like this also..
..
another way :
elif 25 <= sum <= 30: #means in between python allows this:
elif sum > 30: # you can remove this condition, just use else..
print("Obesity")
these are other possible ways you can go with..
hope these helps.. search bar will give you lot of answers...
edit:
https://www.sololearn.com/discuss/637206/?ref=app
+ 2
Thank you for you answers very much!
+ 1
Linked my code
0
You're welcome..