陪玖情感
您的当前位置:首页如何用python求第三条边边长

如何用python求第三条边边长

来源:陪玖情感
 用Python实现“已知三角形两个直角边,求斜边”

要求:用户输入两个直角边(数值为浮点类型),若非浮点类型,则提示用户,继续输入。

思路:伪代码描述下步骤

1、-input a value for the base as a float(输入某浮点数作为底边值)

2、-input a value for the height as a float(输入某浮点数作为高的值)

3、-square root--b squared plus h squared(求平方和和开根号)

4、-save that as a float in hype,for hypotenuse(把结果存为hyp,表示斜边)

5、-print something out,using the value in hyp.(打印出结果)

显示全文