python头歌实践教学平台-python第三章作业(初级)

慈云数据 7个月前 (04-27) 技术支持 46 0

第1关 判断是否直角三角形

python头歌实践教学平台-python第三章作业(初级)
(图片来源网络,侵删)
a=eval(input())
b=eval(input())
C=eval(input())
shortest=min(a,b,c)
longest=max(a,b,c)
middle=sum([a,b,c])-shortest-longest
if shortestb and b+c>;a:
    s=(a+b+c)/2
    area=(s*(s-a)*(s-b)*(s-c))**0.50
    print('YES')
    print(f'{area:.2f}')
else:
    print('NO')

第4关 身高测算

father_h=int(input())
mother_h=int(input())
child=input()
if child=="男":
    child_h=(father_h+mother_h)*1.08/2
    print(int(child_h))
elif child=="女":
    child_h=((father_h*0.923)+mother_h)/2
    print(int(child_h))
else:
     print(f'无对应公式')

第5关 个税计算

n=eval(input())
x=0
if n
微信扫一扫加客服

微信扫一扫加客服

点击启动AI问答
Draggable Icon