猫史档案馆


【Python作品分享】缤纷五环【作业帖】

用户:FN战队LionFN战队Lion查看:4 回复:2 评论:4 创建时间:2023-02-01T15:34:02


【作品展示】

center_image

 

【作品介绍】

它能画出五环!

 

【作品源代码】

#01-缤纷五环-工程包
import turtle as t 
t.setup(1000,500)
t.pencolor("blue")
t.penup()
t.goto(0,0)
t.pendown()
t.setheading(90)
t.pensize(15)
t.circle(100,360)
t.pencolor("black")
t.penup()
t.goto(-200,0)
t.pendown()
t.setheading(90)
t.pensize(15)
t.circle(100,360)
t.pencolor("red")
t.penup()
t.goto(220, 0)
t.pendown()
t.setheading(90)
t.pensize(15)
t.circle(100, 360)
t.pencolor("yellow")
t.penup()
t.goto(-110, -100)
t.pendown()
t.setheading(90)
t.pensize(15)
t.circle(100, 360)
t.pencolor("green")
t.penup()
t.goto(110, -100)
t.pendown()
t.setheading(90)
t.pensize(15)
t.circle(100, 360)
t.done()

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
Chen_ai108Chen_ai108

 

t.penup()
t.goto()
t.pendown()
t.setheading()
t.pencolor()
'''这几行是不是可以封装成函数?这就不用显得那么冗余了'''

 

 

点赞0


评论


楊錦和jrf6楊錦和jrf6

可以用列表和函数,这样更简便。

 

点赞0


评论