python第一次作业

#有趣故事

name1=input('请输入一个名字:')
vehicle=input('请输入一个地方:')
name2=input('输入一种动物:')


print('突然想学游泳的{0},跟着正在{1}的{2}游着游着,便学会了蛙泳。'.format(name1,vehicle,name2))

 

#华氏温度 与 摄氏温度的相互转换

huaTemp =float(input('请输入一个华氏度温度:'))
sheTemp =float(input('请输入一个摄氏度温度:'))
toShe = round(5 / 9 * (huaTemp - 32) )
toHua = round(sheTemp * 9 / 5 + 32)
print('华氏度{}转换为摄氏度为:{}'.format(huaTemp, toShe))
print('摄氏度{}转换为华氏度为:{}'.format(sheTemp, toHua))

posted @ 2018-09-06 11:32  a-庄儿  阅读(173)  评论(0编辑  收藏  举报