用Python画出奥运五环

用海龟画图就是这么简单

coordA=(-110,0,110,-55,55)
coordB=(-25,-25,-25,-75,-75)
cl=("red","blue","green","yellow","black")
i=0

from turtle import *
pensize(5)
for _ in range (5) :
    color(cl[i])
    penup()
    goto(coordA[i],coordB[i])
    pendown()
    circle(45)
    i=i+1
exitonclick()

posted @ 2015-05-01 22:28  人工智障搬运工  阅读(3639)  评论(0编辑  收藏  举报