python三角形判定怎么做-Python教程

资源魔 44 0

python三角形断定怎样做?上面给各人带来详细的例子:

相干保举:《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 = 3
The length of the side b = 4
The length of the side c = 5
This is Scalene
The length of the side a = 3
The length of the side b = 3
The length of the side c = 3
This is an Equilateral
The length of the side a = 3
The length of the side b = 3
The length of the side c = 4
This is Isosceles

以上就是python三角形断定怎样做的具体内容,更多请存眷资源魔其它相干文章!

标签: Python python教程 python编程 python使用问题 三角形判定

抱歉,评论功能暂时关闭!