I didn't want to upload this , In order to maintain CSDN medal , I hope to understand .
There is no technical content , Is to test some logic , No joy, no spray. .
Enter three numbers ( Floating point data support ), Determine whether it is a triangle and its type , Side length range [1-200].
The notes are perfect , Self understanding .
execution environment Ubuntu18.04 Pycharm
Code:
def funtest():
edge_list = [0, 0, 0]
edge_list[0] = float(input("Edge1:"))
edge_list[1] = float(input("Edge2:"))
edge_list[2] = float(input("Edge3:"))
edge_list.sort()
temp1 = edge_list[0] ** 2
temp2 = edge_list[1] ** 2
temp3 = edge_list[2] ** 2
if (edge_list[0] < 1 or edge_list[1] > 200) and (edge_list[1] < 1 or edge_list[1] > 200) and (
edge_list[2] < 1 or edge_list[2] > 200):
print("Edge Error")
return
temp = temp1 + temp2
if edge_list[0] + edge_list[1] > edge_list[2]:
if edge_list[0] == edge_list[1] or edge_list[1] == edge_list[2] or edge_list[2] == edge_list[0]:
if temp == temp3:
print(" Right angle isosceles ")
elif edge_list[0] == edge_list[1] and edge_list[1] == edge_list[2]:
print(" Equilateral ")
else:
print(" Isosceles ")
elif temp == temp3:
print(" Right angle ")
else:
print(" commonly ")
else:
print(" Non triangle ")
funtest()