-1
Forgive me if it’s a stupid question, but I’m a beginner. I have to use the while condition to finish the program. In this case, the code has to rotate while the weight is different from 0. And, if the weight is 0, display the invalid weight message and then finish running the program. You can help me?
nome_lutador = str(input('Digite o nome do lutador: '))
peso_lutador = float(input('Digite o peso do lutador: '))
categoria = 0
if peso_lutador < 65:
categoria = 'Pena'
if peso_lutador >= 65 and peso_lutador < 72:
categoria = 'Leve'
if peso_lutador >= 72 and peso_lutador < 79:
categoria = 'Ligeiro'
if peso_lutador >= 79 and peso_lutador < 86:
categoria = 'Meio-medio'
if peso_lutador >= 86 and peso_lutador < 93:
categoria = 'Medio'
if peso_lutador >= 93 and peso_lutador < 100:
categoria = 'Meio-pesado'
if peso_lutador >= 100:
categoria = 'Pesado'
print('O lutador', nome_lutador, 'pesa', peso_lutador, 'kg e se enquadra na categoria', categoria)
https://answall.com/q/336185/101, https://answall.com/q/446743/101, https://answall.com/q/446980/101 I think one of these solves the problem.
– Maniero
Just a detail that no one commented below, that can simplify the
if's: https://ideone.com/OFFFjUM– hkotsubo