Answer:
Written in Python
print("Enter three sides of a triangle: ")
length = []
for i in range(0,3):
inp = int(input(""))
length.append(inp)
length.sort()
if length[1]+length[2] > length[0] and length[0] + length[2] > length[1] and length[0] + length[1] > length[2]:
print("Triangle")
if length[2]**2 == length[0]**2 + length[1] **2:
print("Right Angled")
else:
print("Not Right Angled")
else:
print("Not Triangle")
Step-by-step explanation:
This line prompts user for sides of triangle
print("Enter three sides of a triangle: ")
This line declares an empty list
length = []
The following iteration gets user input
<em>for i in range(0,3):</em>
<em> inp = int(input(""))</em>
<em> length.append(inp) </em>
This line sorts user input
length.sort()
The following if condition checks if user input is triangle
if length[1]+length[2] > length[0] and length[0] + length[2] > length[1] and length[0] + length[1] > length[2]:
The following is executed is the if condition is true
print("Triangle")
The following if condition checks if user input forms a right angled triangle
<em> if length[2]**2 == length[0]**2 + length[1] **2:</em>
<em> print("Right Angled")</em>
<em> else:</em>
<em> print("Not Right Angled")</em>
This is executed if user input is not a triangle
<em>else:</em>
<em> print("Not Triangle")</em>
<em></em>