日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

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

新聞中心

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

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

寫一個(gè) Python 程序,如果給出兩個(gè)角,用一個(gè)實(shí)例來(lái)求三角形的角。

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

這個(gè) python 程序幫助用戶輸入三角形的兩個(gè)角度。接下來(lái),我們從 180°減去這兩個(gè)角度,因?yàn)槿切沃兴薪嵌鹊目偤? 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 程序使用兩個(gè)角度查找三角形的角度示例 2

這個(gè) 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)頁(yè)標(biāo)題:Python程序:給定兩個(gè)角的情況下計(jì)算三角形的角
轉(zhuǎn)載源于:http://www.dlmjj.cn/article/dhdiphj.html