用python实现表白

from turtle import *
from time import sleep
def go_to(x, y):
    up()
    goto(x, y)
    down()
def small_Circle(size):  # 函数用于绘制心的小圆
    speed(10)
    for i in range(210):
        forward(size)
        right(0.786)
def big_Circle(size):  # 函数用于绘制心的大圆
    speed(10)
    for i in range(150):
        forward(size)
        right(0.3)
def line(size):
    speed(10)
    forward(51 * size)
def heart(x, y, size):
    go_to(x, y)
    left(150)
    begin_fill()
    line(size)
    big_Circle(size)
    small_Circle(size)
    left(120)
    small_Circle(size)
    big_Circle(size)
    line(size)
    end_fill()
def main():
    pensize(2)
    color('red', 'pink')
    getscreen().tracer(1, 0)
    heart(100, 0, 0.7)
    go_to(80, 70)
    write("先生", font=("楷体", 18, "normal"))
    setheading(0)
    heart(-80, -100, 1)
    go_to(-110, 15)
    write("小姐", font=("宋体", 20, "normal"))
    go_to(40, -80)
    write("我们在一起吧", move=True, align="left", font=("arial", 22, "italic"))
    done()
main()

用python实现表白_第1张图片

拿去给你喜欢的人表白吧!

你可能感兴趣的:(python)