-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTriangles.py
More file actions
12 lines (11 loc) · 847 Bytes
/
Triangles.py
File metadata and controls
12 lines (11 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
sideA = float(input('Enter the first side value of the triangle: '))
sideB = float(input('Enter the second side value of the triangle: '))
sideC = float(input('Enter the third side value of the triangle: '))
if (sideA < sideB + sideC and sideB < sideA + sideC and sideC < sideA + sideB ) and (sideA == sideB == sideC):
print('The figure is an equilateral triangle (all sides are equal)')
elif (sideA < sideB + sideC and sideB < sideA + sideC and sideC < sideA + sideB) and (sideA != sideB != sideC):
print('The figure is an scalene triangle (all sides are different)')
elif (sideA < sideB + sideC and sideB < sideA + sideC and sideC < sideA + sideB) and ((sideA == sideB) or (sideA == sideC) or (sideB == sideC)):
print('The figure is an isosceles triangle (only two sides are equal)')
else:
print('The figure is not a triangle')