新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Python程序:計算等腰三角形面積
創(chuàng)新互聯(lián)python教程:

成都創(chuàng)新互聯(lián)是一家專業(yè)提供修武企業(yè)網(wǎng)站建設,專注與成都網(wǎng)站制作、網(wǎng)站設計、HTML5、小程序制作等業(yè)務。10年已為修武眾多企業(yè)、政府機構等服務。創(chuàng)新互聯(lián)專業(yè)網(wǎng)絡公司優(yōu)惠進行中。
寫 Python 程序求等腰三角形面積。這個 python 示例允許輸入等腰三角形邊的長度,并使用數(shù)學公式找到該面積。
# Python Program to find Isosceles Triangle Area
import math
a = float(input("Enter Isosceles Triangle SideLength : "))
b = float(input("Enter the Other Side of Isosceles Triangle : "))
isosceleArea = (b * math.sqrt((4 * a * a) - (b * b)))/4;
print("The Area of the Isosceles Triangle = %.3f" %isosceleArea) Python 面積的一個 n 等腰三角形輸出
Enter Isosceles Triangle SideLength : 10
Enter the Other Side of Isosceles Triangle : 8
The Area of the Isosceles Triangle = 36.661在這個 Python 程序中,我們創(chuàng)建了一個等值三角形面積函數(shù)來尋找等腰三角形的面積。
# Python Program to find Isosceles Triangle Area
import math
def IsoscelesTriangleArea(a, b):
return (b * math.sqrt((4 * a * a) - (b * b)))/4
a = float(input("Enter Isosceles Triangle Side Length : "))
b = float(input("Enter the Other Side of Isosceles Triangle : "))
isosceleArea = IsoscelesTriangleArea(a, b)
print("The Area of the Isosceles Triangle = %.3f" %isosceleArea) 文章標題:Python程序:計算等腰三角形面積
本文URL:http://fisionsoft.com.cn/article/dhdcsip.html


咨詢
建站咨詢
