日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Python程序:給定兩個角的情況下計算三角形的角

創(chuàng)新互聯(lián)Python教程:

寫一個 Python 程序,如果給出兩個角,用一個實例來求三角形的角。

如果給出兩個角,Python 程序可以找到三角形的角示例 1

這個 python 程序幫助用戶輸入三角形的兩個角度。接下來,我們從 180°減去這兩個角度,因為三角形中所有角度的總和= 180°。

# Python Program to find Angle of a Triangle if two angles are given

a = float(input('Please Enter the First Angle of a Triangle: '))
b = float(input('Please Enter the Second Angle of a Triangle: '))

# Finding the Third Angle
c = 180 - (a + b)

print("Third Angle of a Triangle = ", c)

Python 程序使用兩個角度查找三角形的角度示例 2

這個 Python 求三角形角度的代碼同上。然而,我們使用函數(shù)的概念分離了三角形的角度程序邏輯。

# Python Program to find Angle of a Triangle if two angles are given

def triangle_angle(a, b):
    return 180 - (a + b)

a = float(input('Please Enter the First Angle of a Triangle: '))
b = float(input('Please Enter the Second Angle of a Triangle: '))

# Finding the Third Angle
c = triangle_angle(a, b)
print("Third Angle of a Triangle = ", c)

三角形輸出的 Python 角度

Please Enter the First Angle of a Triangle: 45
Please Enter the Second Angle of a Triangle: 95
Third Angle of a Triangle =  40.0

網(wǎng)站標(biāo)題:Python程序:給定兩個角的情況下計算三角形的角
當(dāng)前網(wǎng)址:http://m.5511xx.com/article/dhdiphj.html