day_1 1_奥运五环
import turtleturtle.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()
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) 这个有创意 Python里面的一个turtle 海龟的入门级案例,加油 for i in range(5):
turtle.up()
turtle.goto(locationa)
turtle.width(5)
turtle.pencolor(color)
turtle.down()
turtle.circle(50)
====== 学习画5环。 每行一只海龟 不错啊支持 六楼正解
页:
[1]
2