分享

python计算半径为 2 的圆的面积并打印输出

 融水公子 2019-07-02

讲解对象:python计算半径为 2 的圆的面积并打印输出

作者:融水公子 rsgz

问题描述:

python计算半径为 2 的圆的面积并打印输出

1 touch命令新建空白文件 

2 vim打开文件

3 进入插入模式

命令:i


4 输入代码

import math                

r=2.0                      

s=r*r*math.pi              

print("{:.10f}".format(s))  

5 退出保存文件

esc

:wq

6 赋权

chmod +x CircleArea.py

7 运行Python脚本

python3  ./CircleArea.py

    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多