python turtle 002代码表白
代码:pythonturtle002表白资源-CSDN文库
# 作者V w1933423 import turtle import math def draw_love(): # 创建turtle画笔 t = turtle.pen() t = turtle # 提起画笔,移动到起始位置 t.up() t.goto(0, 150) t.down() # 设置颜色并开始填充 t.color('red') t.begin_fill() t.fillcolor('red') t.speed(5) # 画红色多边形的第一部分 t.left(45) t.forward(150) t.right(45) t.forward(100) t.right(45) t.forward(100) t.right(45) t.forward(100) t.right(45) t.forward(250 + math.sqrt(2) * 100) t.right(90) t.speed(2) t.forward(250 + 100 * math.sqrt(2)) t.right(45) t.forward(100) t.right(45) t.forward(100) t.right(45) t.forward(100) t.right(45) t.forward(150) # 结束填充 t.end_fill() # 移动画笔位置 t.goto(-10, 0) t.pencolor('white') # 画字母'L' t.pensize(10) t.goto(-50, 0) t.goto(-50, 80) t.up() # 画字母'I' # 作者V w1933423
文章版权声明:除非注明,否则均为主机测评原创文章,转载或复制请以超链接形式并注明出处。