+ 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

4th Jun 2023, 5:48 PM
Diego Velasco de la torre
Diego Velasco de la torre - avatar
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.
4th Jun 2023, 6:02 PM
Lothar
Lothar - avatar
+ 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.
4th Jun 2023, 9:57 PM
Emerson Prado
Emerson Prado - avatar
+ 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
7th Jun 2023, 5:25 PM
Diego Velasco de la torre
Diego Velasco de la torre - avatar
+ 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.
4th Jun 2023, 10:54 PM
Emerson Prado
Emerson Prado - avatar
+ 1
How is this hard? Are you trolling?
4th Jun 2023, 11:56 PM
Jared
Jared - avatar
+ 1
5th Jun 2023, 10:38 PM
Emerson Prado
Emerson Prado - avatar
+ 1
JAISHANKAR V What do you mean?
6th Jun 2023, 10:12 AM
Emerson Prado
Emerson Prado - avatar
+ 1
JAISHANKAR V Still very confusing. Are you suggesting the OP to send the answer somewhere? If so, where? And what for?
8th Jun 2023, 10:58 PM
Emerson Prado
Emerson Prado - avatar
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
4th Jun 2023, 7:31 PM
Diego Velasco de la torre
Diego Velasco de la torre - avatar
0
Lothar I wrote it correct me please my other post
4th Jun 2023, 7:33 PM
Diego Velasco de la torre
Diego Velasco de la torre - avatar
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
4th Jun 2023, 10:26 PM
Artin Azari
Artin Azari - avatar
0
Emerson Prado What is op?
5th Jun 2023, 5:22 PM
Diego Velasco de la torre
Diego Velasco de la torre - avatar
5th Jun 2023, 5:22 PM
Diego Velasco de la torre
Diego Velasco de la torre - avatar
0
Hi.. Python code send to Tom and Bob
6th Jun 2023, 6:12 AM
JAISHANKAR V
0
Practice chatbot v 1.0 python code send the answer
8th Jun 2023, 7:33 AM
JAISHANKAR V
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
11th Jun 2023, 6:51 AM
Diego Velasco de la torre
Diego Velasco de la torre - avatar