-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path05_code.py
More file actions
31 lines (29 loc) · 1.09 KB
/
05_code.py
File metadata and controls
31 lines (29 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# This code input all three angle of triangle
'''Sum of all angles in a triangle = 180°
a,b,c as all angles
sum of a,b,c=180°,means triangle exists '''
while True:
print("Check the tringle \nType check to process\nType any key to terminate")
irt=input("Enter your choice:").lower()
if irt=='check':
try:
a=float(input("Enter First angle:"))
b=float(input("Enter second angle:"))
c=float(input("Enter third angle:"))
if a<=0 or b<=0 or c<=0:
print("Invalid$")
else:
sum_of_angle=a+b+c
if (sum_of_angle-180.00)< 0.0001:
print("--The Triangle exists--")
print()
else:
print("---The Triangle cannot exists---")
print()
except ValueError:
print("---Input valid things" \
"please !!!!!")
else:
print("---Trminated---")
print()
break