Python 官方文档:入门教程 => 点击学习
第1关:温度转换 # 请在此添加代码########## Begin ##########def convert(c): f=1.8*c+32 return f########## End ##########C = eva
# 请在此添加代码########## Begin ##########def convert(c): f=1.8*c+32 return f########## End ##########C = eval(input( "input a number:" ))F = convert( C )print( "%.1f"%F )
# 请在此添加代码from math import *########## Begin ########### 计算三角形的面积def ts(a,b,c): s = (a + b + c) / 2 area = sqrt(s * (s - a) * (s - b) * (s - c)) return area# 主函数def main(): k1, k2, k3, k4, k5, k6, k7 = map(int, input().split(',')) a1 = k1 b1 = k2 c1 = k6 a2 = k3 b2 = k7 c2 = k6 a3 = k5 b3 = k4 c3 = k7 area = ts(a1, b1, c1) + ts(a2, b2, c2) + ts(a3, b3, c3) print("area=%.5f" % area)########## End ##########main()
# 请在此添加代码from math import *
来源地址:https://blog.csdn.net/qq_36048855/article/details/130525810
--结束END--
本文标题: 头歌python答案 实验6:Python函数
本文链接: https://www.lsjlt.com/news/441263.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0