Python turtle海龟绘制美国队长盾牌

使用Python中的turtle模块绘制美队盾牌

具体思路如下:

  1. 导入海龟库
  2. 第1个圆:半径 200,红色填充
  3. 第2个圆:半径 150,白色填充
  4. 第3个圆:半径 100,红色填充
  5. 第4个圆:半径 50,蓝色填充

代码如下:(仅供参考,如有错误欢迎指正)

python 复制代码
# 导入海龟库
import turtle
t=turtle.Turtle()
t.shape('turtle')
t.speed(0)

# 第一个圆:红色,半径200
t.up()
t.goto(0,-200)
t.down()
t.color('red')
t.begin_fill()
t.circle(200)
t.end_fill()

# 第二个圆:白色,半径150
t.up()
t.goto(0,-150)
t.down()
t.color('white')
t.begin_fill()
t.circle(150)
t.end_fill()

# 第三个圆:红色,半径100
t.up()
t.goto(0,-100)
t.down()
t.color('red')
t.begin_fill()
t.circle(100)
t.end_fill()

# 第四个圆:蓝色,半径50
t.up()
t.goto(0,-50)
t.down()
t.color('blue')
t.begin_fill()
t.circle(50)
t.end_fill()

# 画五角星
t.up()
t.goto(-40,15)
t.down()
t.color('white')
t.begin_fill()
for i in range(5):
    t.forward(80)
    t.right(144)
t.end_fill()

# 海龟隐藏hideturtle、显示show
t.hideturtle()
t.hideturtle()

运行效果

相关推荐
FYKJ_20102 分钟前
springboot刑事案件管理系统03047-计算机课程设计、毕业设计
vue.js·spring boot·python·mysql·typescript·spark·django
文飞AI智能写作20 分钟前
文献阅读笔记怎么做,写综述时才能找到依据
经验分享·大学生·论文写作·文飞ai
Python图像识别1 小时前
18-【2027毕设】YOLO11烟雾检测识别系统 - Python完整源码+PyQt5界面+训练模型+数据集
python·深度学习·yolo·毕业设计·毕设
FYKJ_20101 小时前
springboot助农产品销售商城05829-计算机课程设计、毕业设计
java·spring boot·python·mysql·spark·django
Yunovian1 小时前
AI时代,针对模型与应用,浅谈一下各编程语言
开发语言·c++·人工智能·python·ai·rust·ai编程
weixin_457760001 小时前
基于 YOLO11m-Pose 的动物姿态估计系统:从 Animal-Pose 标注到 Python 桌面部署
人工智能·python·深度学习
Ticnix2 小时前
RAG 烂大街?烂大街的只是那条流水线——真正的分水岭在这五处
后端·python·agent
Wx-bishekaifayuan2 小时前
springboot社区扶贫救助管理系统13300-计算机课程设计、毕业设计
spring boot·后端·python·django·课程设计·express·旅游
周杰伦fans2 小时前
构建真正智能的CAD AI绘图代理
开发语言·人工智能·c#
小小张说故事3 小时前
LightGBM 入门指南:更快的梯度提升树,Python 实战
后端·python·机器学习