猫史档案馆


【Python作品分享】奥运五环【教程贴】

用户:聪明伶俐的阿越z_y聪明伶俐的阿越z_y查看:0 回复:1 评论:0 创建时间:2020-05-15T15:39:21


【作品展示】

center_image

 

【作品介绍】

import turtle

t = turtle.Pen()

t.speed(0)

t.pensize(10)

def circle(x):

t.pencolor(x)

t.circle(50)

def goto(x,y):

t.penup()

t.goto(x, y)

t.pendown()

circle("red")

goto(-70,0)

circle("black")

goto(-140, 0)

circle("blue")

goto(-35, -70)

circle("green")

goto(-100, -70)

circle("yellow")

turtle.done()

 

【作品源代码】

import turtle
t = turtle.Pen()
t.speed(0)
t.pensize(10)

def circle(x):
    t.pencolor(x)
    t.circle(50)

def goto(x,y):
    t.penup()
    t.goto(x, y)
    t.pendown()

circle("red")
goto(-70,0)
circle("black")
goto(-140, 0)
circle("blue")
goto(-35, -70)
circle("green")
goto(-100, -70)
circle("yellow")

turtle.done()

 

【提示】

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

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
不起眼的账号不起眼的账号

学而思真香

点赞0


评论