Ideal Height Of One Person

Asked

Viewed 22 times

-4

Here is the code:

Create a program that reads the ideal weight of a person of both sexes

  • For men: (72.7*Height) -58
  • For women: (62.1*Height) - 44.7
print('PESO IDEAL DE UMA PESSOA')
Genêro_da_pessoa=str(input('Qual é o seu sexo?'))
Altura_da_pessoa= float(input('Qual é a sua altura?'))
Peso_ideal_para_homens= (Genêro_da_pessoa*Altura_da_pessoa)-59
Peso_ideal_para_mulheres= (Genêro_da_pessoa*Altura_da_pessoa)-44.7
if Peso_ideal_para_homens == True:
  print(f'{Peso_ideal_para_homens}')
elif Peso_ideal_para_mulheres == True:
  print(f'{Peso_ideal_para_mulheres}')

I am unable to execute the code correctly, some of you know the error?

  • 1

    There is more than one error, first and most evident, trying to compare calculation results with True, which makes no sense, second, this applying a multiplication operation with a variable of type str (Genêro_da_pessoa), which also makes no sense, multiply ('man' x 75)-59

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.