9.2日第一次python作业

这篇博客主要介绍了9月2日Python初学者所面临的作业内容,涵盖了基础语法和简单编程练习,旨在帮助新手巩固知识。
摘要由CSDN通过智能技术生成
'''
第一天 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: ' ))
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值