'''
第一天 1.1
摄氏温度转华氏温度
celsius = float(input('Enter a degree in Celsius: '))
fahrenheit = float((9/5) * celsius + 32)
print ('%d Celsius is %.1f Fahrenheit'%(celsius, fahrenheit ))
'''
'''1.2
输入圆柱体半径和高,求其底面积和体积
r,l = map(float, (input('Enter the radius and length of a cylinder: ' ).split()))
area = float(r * r * 3.14159)
volume = area * l
print ('The area is %.4f'%(area))
print ('The volume is %.1f'%(volume))
'''
''' 1.3
英尺换算米数
f = float(input('Enter a value for feet: '))
m = float (f * 0.305)
print ('%.1f feet is %.4f meters' %(f,m))
'''
'''1.4
计算加热水的能量
输入水公斤数
输入水初始温度
输入水最终温度
计算所需能量为多少
M = float(input ('Enter the amount of water in kilograms: '))
i = float(input('Enter the initial temperature : '))
f = float(input('Enter the final temperature: ' ))
9.2日第一次python作业
最新推荐文章于 2021-01-29 21:52:16 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)