如何用python的turtle海龟制图画一个不正经的爱心❤️

# coding=utf-8
import turtle
import time

def draw_circle():
    for i in range(400):
        turtle.right(0.5)
        turtle.forward(1)
def draw_love():
#    turtle.color('red','darkred')
#    turtle.pensize(1)
    turtle.pen(fillcolor="black",pencolor="red",pensize=8)
    turtle.speed(2000)
    turtle.goto(0,0)
    turtle.begin_fill()
    turtle.left(140)
    turtle.forward(224)
    draw_circle()
    turtle.left(120)
    draw_circle()
    turtle.forward(224)
    turtle.end_fill()
    turtle.write("I Love you")
    time.sleep(2)
    turtle.up()
    turtle.goto(150,20)
    turtle.color('black')
    turtle.write('相夕妄想 来日方长 很喜欢你 到此为止',font=("微软雅黑",18,"normal"))
    time.sleep(2)
def draw_abc():
    turtle.fillcolor("black")
    turtle.pencolor("red")
    turtle.pensize(10)
    turtle.speed(1)
    turtle.up()
    turtle.goto(0,-50)
    turtle.down()
    turtle.begin_fill()
    turtle.circle(45)
    turtle.end_fill()
    time.sleep(2)
def word():
    turtle.up()
    turtle.goto(-100,200)
    turtle.color("red")
    turtle.pensize(4)
#   turtle.down()
    turtle.write('宝贝,你以为你是唯一吗?',font=("隶书",18,"bold"))
    time.sleep(10)
draw_love()
draw_abc()
word()

附上沙雕成品图:

如何用python的turtle海龟制图画一个不正经的爱心❤️_第1张图片

你可能感兴趣的:(python练习)