python中使用turtle函数绘图,具体方法如下:
1.绘制一个五角星
from turtle import * #导入turtle模块color('red','red')
begin_fill()
for i in range(5):
fd(200)
rt(144)
end_fill()
done()
效果图:
2.绘制一组内切圆
import turtle #导入turtle模块
turtle.pensize(2)
turtle.circle(10)
turtle.circle(40)
turtle.circle(80)
turtle.circle(120)
效果图: