1.同切圆的绘制
import turtle # 引用turtle库
turtle.pensize(2) # 设置画笔宽度为2像素
turtle.circle(10) #绘制半径为10像素的圆
turtle.circle(40) #绘制半径为40像素的圆
turtle.circle(80) #绘制半径为80像素的圆
turtle.circle(160) #绘制半径为160像素的圆
from turtle import * # 引用turtle库
fillcolor("red") # 设置填充颜色为红色
begin_fill() # 开始绘制
while True:
forward(200)
right(144)
if abs(pos()) < 1:
break
end_fill()
from turtle import * # 引用turtle库
color('red','yellow') # 设置画笔和填充颜色
begin_fill()
while True:
forward(200)
left(170)
if abs(pos()) < 1:
break
end_fill()
done()