- 圆面积的计算
r = 25 area = 3.1415 * r * r print(area) print("{:.2f}".format(area))
-
2、同切圆绘制 turtle了解一下
-
import turtle # 设置画笔的宽度; turtle.pensize(2) # 设置画笔移动速度,画笔绘制的速度范围[0,10]整数,数字越大越快? # turtle.speed(0.0001) turtle.circle(10) turtle.circle(40) turtle.circle(80) turtle.circle(160) # 保存图片 turtle.mainloop()
- 绘制五角星
-
from turtle import * color('red', 'red') begin_fill() for i in range(5): fd(200) rt(144) end_fill() done()
Python语言程序设计(MOOC崇天)第一章学习笔记(温度转换)
最新推荐文章于 2024-04-03 00:16:15 发布