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
相关推荐
nanawinona9 分钟前
2026年下半年量化学习,不同基础要查不同缺口
人工智能·python
CTA量化套保25 分钟前
最新量化表达入门,从概念规则到简单实现
人工智能·python
吃饱了得干活1 小时前
别再手动解析 LLM 输出了!LangChain 四种结构化输出方案对比
后端·python·langchain
吃糖的小孩1 小时前
从只读页面到可控真实探针:我如何给 Owner Console 加手动诊断
前端
谷无姜1 小时前
为什么你的性能优化无效?可能是"木桶效应"在作祟
前端·性能优化
ikun_文1 小时前
Python进阶—函数编程
python·pycharm
雾非雾1 小时前
《基于具身交互智能数字人技术:如何打造AI数字人宣讲平台"红厅智播”》
前端
MC皮蛋侠客1 小时前
uv 系列(三):依赖、锁文件与环境同步——可重复构建的核心
python·uv
量化吞吐机1 小时前
2026年交易想法转Python,中间先补规则转译
人工智能·python
用户298698530141 小时前
Python 实现 Excel 与 Markdown 互转的实用指南
后端·python·excel