Triangle Type

Given three sides, you can tell what kind of triangle they form, or whether a triangle is impossible. The function triangle_kind receives side lengths a, b, and c, then returns equilateral, isosceles, scalene, or invalid. Remember the key rule: the sum of any two sides must be greater than the third side.

Примеры

Ввод
(2, 2, 2)
Вывод
"equilateral"
Ввод
(3, 4, 4)
Вывод
"isosceles"
Ввод
(3, 4, 5)
Вывод
"scalene"

Нужно реализовать

def triangle_kind(a: float, b: float, c: float) -> str:

Теги

math
PostgreSQLv16
Entre para enviar

O resultado da execução do código aparecerá aqui

Visible tests
1
Input
2, 2, 2
Expected"equilateral"
2
Input
3, 4, 4
Expected"isosceles"
3
Input
3, 4, 5
Expected"scalene"
4
Input
1, 1, 3
Expected"invalid"
5
Input
0, 0, 0
Expected"invalid"
6
Input
7, 3, 2
Expected"invalid"
Focus radio
Paused · SomaFM · Fluid