|
1 | | -#Desenvolva uma lógica que leia o peso e a altura de uma pessoa, calcule seu Índice de Massa Corporal (IMC) e |
2 | | -# mostre seu status, de acordo com a tabela abaixo: |
3 | | -# – IMC abaixo de 18,5: Abaixo do Peso |
4 | | -#– Entre 18,5 e 25: Peso Ideal |
5 | | -#– 25 até 30: Sobrepeso |
6 | | -#– 30 até 40: Obesidade |
7 | | -#– Acima de 40: Obesidade Mórbida |
8 | | -peso = float(input("Digite o seu peso em Kg:")) |
9 | | -altura = float(input('Digite a sua altura em metros:')) |
10 | | -imc = peso / (altura ** 2) |
11 | | -print('Seu peso é de {}kg e sua altura é de {}m, logo seu IMC é de {:.2f}.'.format(peso, altura, imc)) |
12 | | -if imc < 18.5: |
13 | | - print('Você está abaixo do peso.') |
14 | | -elif 18.5 <= imc < 25: |
15 | | - print('Você está no seu peso ideal!') |
16 | | -elif 25 <= imc < 30: |
17 | | - print('Você está com sobrepeso.') |
| 1 | +#Develop a logic that reads a person's weight and height, calculates their Body Mass Index (BMI) and |
| 2 | +# shows their status, according to the table below: |
| 3 | +# – BMI below 18.5: Underweight |
| 4 | +#– Between 18.5 and 25: Ideal Weight |
| 5 | +#– 25 to 30: Overweight |
| 6 | +#– 30 to 40: Obesity |
| 7 | +#– Over 40: Morbidly Obese |
| 8 | +weight = float(input("Enter your weight in Kg:")) |
| 9 | +height = float(input('Enter your height in meters:')) |
| 10 | +bmi = weight / (height ** 2) |
| 11 | +print(f'Your weight is {weight}kg and your height is {height}m, your BMI is {bmi:.2f}.') |
| 12 | +if bmi < 18.5: |
| 13 | + print('You are underweight.') |
| 14 | +elif 18.5 <= bmi < 25: |
| 15 | + print('You are ideal weight!') |
| 16 | +elif 25 <= bmi < 30: |
| 17 | + print('You are overweight.') |
18 | 18 | elif 30 <= 40: |
19 | | - print('Você está obeso.') |
20 | | -elif imc >= 40: |
21 | | - print('Você esta com obesidade mórbida.') |
| 19 | + print('You are obesity.') |
| 20 | +elif bmi >= 40: |
| 21 | + print('You are morbidly obese.') |
0 commit comments