1 级任务
1) 华氏度到摄氏度转换
f=int(input("Enter the no. ")) c=5/9*(f-32) print("Fahrenheit to celsius",round(c))
输出:
Enter the no. 108 Fahrenheit to celsius 42
2) 摄氏度到华氏度转换
c=int(input("Enter the no. ")) f=c*(9/5)+32 print("celsius to fahrenheit",round(f))
输出:
Enter the no. 42 celsius to fahrenheit 108
3) 英尺到米的转换
#1 Feet = 0.3048 meters feet=float(input("Enter the no. ")) meter=feet*0.3048 print("feet to meters",round(meter,1))
输出:
Enter the no. 15 feet to meters 4.6
4) 正方形的输入侧、输出区域
side=float(input("Enter the no. ")) area=side**2 print("Area of a square is ",area)
输出:
Enter the no. 5 Area of a square is 25.0
5) 输入-长、宽;输出-矩形面积
#Area of a Rectangle=length*breadth length=float(input("Enter length of the rectangle. ")) breadth=float(input("Enter breadth of the rectangle. ")) area=length*breadth print("Area of a rectangle is ",area)
输出:
Enter length of the rectangle. 5 Enter breadth of the rectangle. 10 Area of a rectangle is 50.0
6) 半径 - 圆的面积
#Area of circle = πr2 r=int(input("Enter the radius of circle: ")) area=3.14*(r**2) print("Area of the circle is ",area)
输出:
Enter the radius of circle: 5 Area of the circle is 78.5
7) 美元 转换为 INR
#usd=Rs. 84.56 dollar=float(input("Enter currency in dollars: ")) usd=dollar*84.56 print("Currency in rupees is =",usd)
输出:
Enter currency in dollars: 500 Currency in rupees is = 42280.0
以上是Python - 级别:询问的详细内容。更多信息请关注PHP中文网其他相关文章!

Linux终端中查看Python版本时遇到权限问题的解决方法当你在Linux终端中尝试查看Python的版本时,输入python...

本文解释了如何使用美丽的汤库来解析html。 它详细介绍了常见方法,例如find(),find_all(),select()和get_text(),以用于数据提取,处理不同的HTML结构和错误以及替代方案(SEL)

本文比较了Tensorflow和Pytorch的深度学习。 它详细介绍了所涉及的步骤:数据准备,模型构建,培训,评估和部署。 框架之间的关键差异,特别是关于计算刻度的

本文指导Python开发人员构建命令行界面(CLIS)。 它使用Typer,Click和ArgParse等库详细介绍,强调输入/输出处理,并促进用户友好的设计模式,以提高CLI可用性。

在使用Python的pandas库时,如何在两个结构不同的DataFrame之间进行整列复制是一个常见的问题。假设我们有两个Dat...

本文讨论了诸如Numpy,Pandas,Matplotlib,Scikit-Learn,Tensorflow,Tensorflow,Django,Blask和请求等流行的Python库,并详细介绍了它们在科学计算,数据分析,可视化,机器学习,网络开发和H中的用途

文章讨论了虚拟环境在Python中的作用,重点是管理项目依赖性并避免冲突。它详细介绍了他们在改善项目管理和减少依赖问题方面的创建,激活和利益。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

PhpStorm Mac 版本
最新(2018.2.1 )专业的PHP集成开发工具

Atom编辑器mac版下载
最流行的的开源编辑器

mPDF
mPDF是一个PHP库,可以从UTF-8编码的HTML生成PDF文件。原作者Ian Back编写mPDF以从他的网站上“即时”输出PDF文件,并处理不同的语言。与原始脚本如HTML2FPDF相比,它的速度较慢,并且在使用Unicode字体时生成的文件较大,但支持CSS样式等,并进行了大量增强。支持几乎所有语言,包括RTL(阿拉伯语和希伯来语)和CJK(中日韩)。支持嵌套的块级元素(如P、DIV),

Dreamweaver Mac版
视觉化网页开发工具