sairate 7df250638d chore: 添加项目基础结构和示例代码
- 创建 .idea 目录和相关配置文件,设置项目结构
- 添加多个课堂成果示例代码,涵盖不同主题和功能
- 创建和配置 .gitignore 文件,忽略特定文件和目录
2025-07-05 09:36:00 +08:00

31 lines
596 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import turtle as t
t.shape('turtle')
# 不画线,移到(0200)
t.penup()
t.goto(0,200)
t.pendown()
# 画线(0,200)——>(0,0)
t.goto(0,0)
# 画长方形(0,0)——>(50,0)——>(50,-25)——>(-50,-25)——>(-50,0)——>(0,0)
t.setx(50)
t.sety(-25)
t.setx(-50)
t.sety(0)
t.setx(0)
# 不画线,移到(-50-25)
t.penup()
t.goto(-50,-25)
t.pendown()
# 画梯形(-50,-25)——>(50,-25)——>(150,-75)——>(-150,-75)——>(-50,-25)
t.setx(50)
t.goto(150,-75)
t.setx(-150)
t.goto(-50,-25)
#不画线,移到(0-100)
t.penup()
t.goto(0,-100)
t.pendown()
#画圆
t.circle(30)
t.done()