-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathtask7.py
More file actions
19 lines (17 loc) · 1.06 KB
/
task7.py
File metadata and controls
19 lines (17 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# По длинам трех отрезков, введенных пользователем, определить возможность существования треугольника,
# составленного из этих отрезков. Если такой треугольник существует, то определить,
# является ли он разносторонним, равнобедренным или равносторонним.
print('Plese provide lengths sides of triangle:')
l1 = float(input('\tl1 = '))
l2 = float(input('\tl2 = '))
l3 = float(input('\tl3 = '))
if l1 < l2 + l3 and l2 < l1 + l3 and l3 < l1 + l2 :
print (f'It is possible to create triangle from provided sides')
if l1 != l2 and l2 != l3 and l3 != l1 :
print(f'Here is an scalene triangle')
elif l1 == l2 and l2 == l3 and l3 == l1 :
print(f'Here is an equilateral triangle')
elif l1 == l2 or l1 == l3 or l2 == l3 :
print(f'Here is an isosceles triangle')
else:
print (f'It is impossible to create triangle from provided sides')