(效果在下面)
代码如下:
import turtle import time
t = turtle.Pen() t.speed(0) t.fillcolor(0, 0, 0) t.begin_fill() t.circle(100) t.end_fill() color = ['red'] t.fillcolor(color[0]) t.pensize(4) t.pencolor('black') for i in range(2): t.begin_fill() t.setheading(0) t.left(60) t.circle(200, 60) t.setheading(180) t.left(60) t.circle(200, 60) t.end_fill() t.setheading(0) t.circle(100, 45) for i in range(2): t.begin_fill() t.setheading(110) t.left(60) t.circle((-199), 60) t.setheading(350) t.circle((-199), 60) t.end_fill() t.penup() t.home() t.pendown() t.circle(100, (-45)) for i in range(2): t.begin_fill() t.setheading(70) t.circle((-199), 60) t.setheading(250) t.circle((-199), 60) t.end_fill() t.penup() t.home() t.pendown() t.circle(100, (-90)) t.setheading(30) for i in range(1): t.begin_fill() t.circle((-201), 60) t.setheading(210) t.circle((-199), 60) t.end_fill()
t.penup() t.goto(5, 105) t.pendown() t.fillcolor('black') t.begin_fill() t.circle(10, 180) t.circle(10, 180) t.end_fill() t.pensize(2) t.pencolor('black') t.penup() t.goto(0, 0) t.pendown() for i in range(2): t.setheading(0) t.left(60) t.circle(200, 60) t.setheading(180) t.left(60) t.circle(200, 60) t.setheading(0) t.circle(100, 45) for i in range(2): t.setheading(110) t.left(60) t.circle((-199), 60) t.setheading(350) t.circle((-199), 60) t.penup() t.home() t.pendown() t.circle(100, (-45)) for i in range(2): t.setheading(70) t.circle((-199), 60) t.setheading(250) t.circle((-199), 60) t.penup() t.home() t.pendown() t.circle(100, (-90)) t.setheading(30) for i in range(1): t.circle((-201), 60) t.setheading(210) t.circle((-199), 60) t.penup() t.goto(175, 150) t.pendown() t.setheading(125) t.circle(200, 140) t.setheading(304) t.circle(199.5, 142) t.penup() t.goto(190,150) t.pendown() t.setheading(125) t.circle(220, 140) t.setheading(304) t.circle(219.5, 142) t.penup() t.setheading(125) t.circle(220, 30) t.setheading(75) t.pendown() t.pensize(2) t.circle(-50,60) t.penup() t.goto(190,150) t.setheading(125) t.pendown() t.circle(220,25) t.setheading(75) t.pendown() t.pensize(2) t.circle(-50, 50) t.penup() t.goto(190, 150) t.setheading(125) t.pendown() t.circle(220, 20) t.setheading(75) t.pendown() t.pensize(2) t.circle(-50, 40) time.sleep(20)
