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
相关推荐
艾上编程几秒前
第三章——爬虫工具场景之Python爬虫实战:行业资讯爬取与存储,抢占信息先机
开发语言·爬虫·python
Pyeako1 分钟前
网络爬虫相关操作--selenium库(超详细版)
爬虫·python·selenium
苏打水com2 分钟前
第十六篇:Day46-48 前端安全进阶——从“漏洞防范”到“安全体系”(对标职场“攻防实战”需求)
前端·javascript·css·vue.js·html
5C244 分钟前
从思想到实践:前端工程化体系与 Webpack 构建架构深度解析
前端·前端工程化
dagouaofei5 分钟前
全面整理6款文档生成PPT工具,PDF转PPT不再难
python·pdf·powerpoint
β添砖java8 分钟前
python第一阶段第10章
开发语言·python
咕噜企业分发小米10 分钟前
如何平衡服务器内存使用率和系统稳定性?
java·服务器·前端
前端无涯10 分钟前
react组件(2)---State 与生命周期
前端·react.js
GoldenPlayer12 分钟前
Web-Tech:CORS的触发机制
前端
AY呀12 分钟前
Vite:现代前端构建工具的革命与实战指南
前端·vue.js·vite