#初始设置 import turtle as t t.shape('turtle') #海龟形状 t.bgcolor('pink') #粉色背景 t.pencolor('black') #黑色画笔 t.pensize(10) #画笔宽度为10 #移到(0,-200),不留下痕迹 t.penup() t.goto(0,-200) t.pendown() #画竖线 t.goto(0,0) #画红色扇叶 t.fillcolor('red') #红色填充 t.begin_fill() #开始填充 t.seth(0) #朝向右 t.forward(100) #前进100像素 t.left(90) #左转90°,朝向左 t.circle(100,45) #画扇叶圆弧,角度45 t.goto(0,0) #回到原点 t.end_fill() #结束填充 #画黄色扇叶 t.fillcolor('yellow') #黄色填充 t.begin_fill() #开始填充 t.seth(90) #朝向上 t.forward(100) #前进100像素 t.left(90) #左转90°,朝向左 t.circle(100,45) #画扇叶圆弧,角度45 t.goto(0,0) #回到原点 t.end_fill() #结束填充 #画绿色扇叶 t.fillcolor('green') #绿色填充 t.begin_fill() #开始填充 t.seth(180) #朝向左 t.forward(100) #前进100像素 t.left(90) #左转90°,朝向下 t.circle(100,45) #画扇叶圆弧,角度45 t.goto(0,0) #回到原点 t.end_fill() #结束填充 #画蓝色扇叶 t.fillcolor('blue') #蓝色填充 t.begin_fill() #开始填充 t.seth(270) #朝向下 t.forward(100) #前进100像素 t.left(90) #左转90°,朝向右 t.circle(100,45) #画扇叶圆弧,角度45 t.goto(0,0) #回到原点 t.end_fill() #结束填充 t.done()