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
相关推荐
b***748814 小时前
前端GraphQL案例
前端·后端·graphql
合作小小程序员小小店14 小时前
web网页,在线%抖音,舆情,线性回归%分析系统demo,基于python+web+echart+nlp+线性回归,训练,数据库mysql
python·自然语言处理·回归·nlp·线性回归
云飞云共享云桌面14 小时前
无需配置传统电脑——智能装备工厂10个SolidWorks共享一台工作站
运维·服务器·前端·网络·算法·电脑
q***25114 小时前
Python中的简单爬虫
爬虫·python·信息可视化
最晚的py14 小时前
Python Matplotlib
python·数据分析
柳鲲鹏14 小时前
OpenCV:文件视频防抖,python版
python·opencv·音视频
ganshenml14 小时前
sed 流编辑器在前端部署中的作用
前端·编辑器
虚伪的空想家15 小时前
arm架构服务器使用kvm创建虚机报错,romfile “efi-virtio.rom“ is empty
linux·运维·服务器·javascript·arm开发·云原生·kvm
0***K89215 小时前
Vue数据挖掘开发
前端·javascript·vue.js
蓝胖子的多啦A梦15 小时前
ElementUI表格错位修复技巧
前端·css·vue.js·el-table表格错位