-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex042.py
More file actions
22 lines (17 loc) · 720 Bytes
/
ex042.py
File metadata and controls
22 lines (17 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Refaça o DESAFIO 35 dos triângulos, acrescentando o recurso de mostrar que tipo de triângulo será formado:
#– EQUILÁTERO: todos os lados iguais
#– ISÓSCELES: dois lados iguais, um diferente
#– ESCALENO: todos os lados diferentes
r1 = float(input('Primeiro segmento: '))
r2 = float(input('Segundo segmento: '))
r3 = float(input('Terceiro segmento: '))
if r1 < r2 + r3 and r2 < r1 + r3 and r3 < r1 + r2:
print('Os segmentos acima PODEM formar um triângulo ', end='')
if r1 == r2 == r3:
print('EQUILÁTERO')
elif r1 != r2 != r3 != r1:
print('ESCALENO')
else:
print('ISÓCELES')
else:
print('Os segmentos NÃO PODEM formar um triângulo.')