+ 1
How can I make the BMI test
I try to make the BMI activity with python (it's on the end of the third part of the course) and I can't make it. I use else, elif and if espered and still nothing. Why is programming so hard
16 Respostas
+ 10
Diego Velasco de la torre ,
please put your code in playground, save it there and post a link to it here.
> without having seen your code it is difficult to know what kind of issue you have.
> also complete your post with the name of the tutorial where the bmi exercise can be found.
+ 4
Aayush Chilkoti Pls avoid giving finished code as answer, because it makes the OP skip the most important part of learning, and encourage the Bad Habit of asking others to solve one's tasks. Prefer giving hints for the OP to find the solution instead.
+ 2
Emerson Prado Lothar Jared Ramon Elizan Artin Azari guys don't worry. I just solved it. The problems were floats and intendations. Thank you guys
+ 1
Artin Azari Pls see my both previous answers. Your answer contains almost all finished code, including the 2 parts the OP would study.
Letting the OP to think helps more than giving the solution ahead. Pls always consider that.
+ 1
How is this hard? Are you trolling?
+ 1
Diego Velasco de la torre Original Poster
+ 1
JAISHANKAR V What do you mean?
+ 1
JAISHANKAR V Still very confusing. Are you suggesting the OP to send the answer somewhere? If so, where? And what for?
0
weight = 23.54
while weight > 30:
print('Obesity')
else:
weight < 29.9
print('Fat')
else:
weight < 24.9
print('Normal')
else:
weight < 18.5
print('Thin')
This is the code I tried with one I saw in the internet and it is too hard ngl
0
Lothar I wrote it correct me please my other post
0
Hi,
You have made some mistakes:
1. BMI is based on height and weight (weight / height²), but you missed height value.
2. You don't need to use "While Loop", because there is no repetition. Here, you should check just one BMI in "if..elif..else" block.
3. The syntax of your code is not correct.
Some parts of code for hint:
weight = int(input()) # in kilograms, like 72
height = float(input()) # in meters, like 1.75
BMI = # Write BMI formula here
if BMI < 18.5:
# Underweight
elif..
.
.
.
else:
# Obesity
0
Emerson Prado What is op?
0
Jared Ramon Elizan no IM new
0
Hi..
Python code send to
Tom and Bob
0
Practice chatbot v 1.0 python code send the answer
0
Emerson Prado I managed to solve it from a Web I saw searching for this. Now I understand this and I managed to solve it. Even thought the code had some problems