python turtle 002代码表白

代码:pythonturtle002表白资源-CSDN文库

python 复制代码
# 作者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
相关推荐
Java后端的Ai之路3 小时前
【Python 教程15】-Python和Web
python
子兮曰5 小时前
OpenClaw入门:从零开始搭建你的私有化AI助手
前端·架构·github
冬奇Lab5 小时前
一天一个开源项目(第15篇):MapToPoster - 用代码将城市地图转换为精美的海报设计
python·开源
吴仰晖5 小时前
使用github copliot chat的源码学习之Chromium Compositor
前端
1024小神5 小时前
github发布pages的几种状态记录
前端
二十雨辰7 小时前
[python]-AI大模型
开发语言·人工智能·python
不像程序员的程序媛7 小时前
Nginx日志切分
服务器·前端·nginx
Yvonne爱编码7 小时前
JAVA数据结构 DAY6-栈和队列
java·开发语言·数据结构·python
Daniel李华7 小时前
echarts使用案例
android·javascript·echarts
北原_春希7 小时前
如何在Vue3项目中引入并使用Echarts图表
前端·javascript·echarts