相关推荐:《python视频教程》
例子:
a = int(input("the length of the side a = "))b = int(input("the length of the side b = "))c = int(input("the length of the side c = "))if a != b and b != c and a != c: print("this is scalene") #不规则三角形elif a == b and b == c: print("this is an equilateral") #等边三角形else: print("this is isosceles") #等腰三角形
结果如下:
the length of the side a = 3the length of the side b = 4the length of the side c = 5this is scalenethe length of the side a = 3the length of the side b = 3the length of the side c = 3this is an equilateralthe length of the side a = 3the length of the side b = 3the length of the side c = 4this is isosceles
以上就是python三角形判定怎么做的详细内容。
