建议安装Pycharm因为它已经准备好了turtle但是先要下载Python,它的官网地址是python.org,Pycharm的windows操作系统的安装的地址是https://www.jetbrains.com/pycharm/download/#section=windows。
代码如下
import turtle
def init():
turtle.pensize(5)
turtle.hideturtle()
turtle.penup()
turtle.penup()
turtle.goto(0, -200)
turtle.pendown()
turtle.speed(5)
def position(x, y, direction):
turtle.penup()
turtle.goto(x, y)
turtle.pendown()
turtle.left(direction)
def draw_circle(color, r, anggle = 360):
turtle.fillcolor(color)
turtle.begin_fill()
turtle.circle(r, anggle)
turtle.end_fill()
init()
draw_circle('black', 200)
position(-160, -15, 270)
draw_circle('white', 160, 180)
position(160, 15, 0)
draw_circle('red', 160, 180)
position(0, -50, 90)
draw_circle('black', 50)
position(0, -40, 0)
draw_circle('white', 40)
position(0, -30, 0)
draw_circle('white', 30)
turtle.done()