TOPIC

wrong answer 5% Python

Falnésio Ghander Soares Borges asked 5 months ago

Não consigo encontrar o caso onde o código falha...

A, B, C = [float(x) for x in input().split()]
formato = [A, B, C]
formato.sort(reverse=True)
A, B, C = formato
condicoes = {
    'NAO FORMA TRIANGULO': A >= B + C,
    'TRIANGULO RETANGULO': A**2 == B**2 + C**2,
    'TRIANGULO OBTUSANGULO': A**2 > B**2 + C**2,
    'TRIANGULO ACUTANGULO': A**2 < B**2 + C**2,
    'TRIANGULO EQUILATERO': A == B == C,
    'TRIANGULO ISOSCELES':  A == B != C 
                or A != B == C 
                or A == C != B
}
[print(chave) for chave, valor in condicoes.items() if valor and not condicoes['NAO FORMA TRIANGULO']]
if condicoes['NAO FORMA TRIANGULO']:
    print('NAO FORMA TRIANGULO')
    print()
else: 
    print()

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.