196729252 发表于 2020-9-8 20:45

day_1 1_奥运五环

import turtle
turtle.setup(1000,1000)
color=['red','blue','green','yellow','black']
locationa=[(0,0),(120,0),(240,0),(55,-55),(175,-55)]


for i in range(5):

    turtle.up()

    turtle.goto(locationa)
    turtle.width(5)
    turtle.pencolor(color)
    turtle.down()
    turtle.circle(50)

#   描边
turtle.penup()         #描红边
turtle.goto(0,100)
turtle.pencolor('red')
turtle.left(180)
turtle.pendown()
turtle.circle(50,-120)


turtle.penup()    #描blue
turtle.goto(120,100)
turtle.pencolor('blue')
turtle.right(240)
turtle.pendown()
turtle.circle(50,180)


turtle.penup() #描blue
turtle.goto(120,100)
turtle.pencolor('blue')
turtle.right(180)
turtle.pendown()
turtle.circle(50,-120)

turtle.penup()#描green
turtle.goto(240,100)
turtle.pencolor('green')
turtle.right(-120)
turtle.pendown()
turtle.circle(50,180)


turtle.penup()
turtle.goto(55,45)
turtle.pencolor('yellow')
turtle.right(180)
turtle.pendown()
turtle.circle(50,-60)

turtle.penup()
turtle.goto(175,45)
turtle.pencolor('black')
turtle.right(-60)
turtle.pendown()
turtle.circle(50,-60)



turtle.mainloop()

seeyou_shj 发表于 2020-9-9 08:31

for i in range(5):
    turtle.up()
    turtle.goto(locationa)
    turtle.width(5)
    turtle.pencolor(color)
    turtle.down()
    turtle.circle(50)
---------------
以上有错误,应改为
for i in range(5):
    turtle.up()
    turtle.goto(locationa)
    turtle.width(5)
    turtle.pencolor(color)
    turtle.down()
    turtle.circle(50)

chrisu 发表于 2020-9-8 22:43

这个有创意

bright21vn 发表于 2020-9-9 06:11

Python里面的一个turtle

Qdove 发表于 2020-9-9 08:30

海龟的入门级案例,加油

seeyou_shj 发表于 2020-9-9 08:30

for i in range(5):
    turtle.up()
    turtle.goto(locationa)
    turtle.width(5)
    turtle.pencolor(color)
    turtle.down()
    turtle.circle(50)
======

daymissed 发表于 2020-9-9 08:36

学习画5环。

c03xp 发表于 2020-9-9 08:42

每行一只海龟

HuangQiguang 发表于 2020-9-9 09:10

不错啊支持

sunyuwa 发表于 2020-9-9 09:51

六楼正解
页: [1] 2
查看完整版本: day_1 1_奥运五环