python一秒画奥运五环

龟叔大法

python一秒画奥运五环

import turtle as tl

def drawCircle(orgin,destination,color,radius):
    tl.width(6)
    tl.speed(10)
    tl.shape("turtle")
    tl.penup()
    tl.goto(orgin,destination)
    tl.pendown()
    tl.color(color)
    tl.circle(radius)
    tl.hideturtle()

def main():

    drawCircle(-100, 0, 'blue', 50)
    
    drawCircle(10, 0, 'black', 50)

    drawCircle(120, 0, 'red', 50)

    drawCircle(-45, -50, 'yellow', 50)

    drawCircle(65, -50, 'green', 50)

    tl.done()


if __name__ == '__main__':

    main()
  • 奥运五环
    在这里插入图片描述
发布了130 篇原创文章 · 获赞 283 · 访问量 24万+

猜你喜欢

转载自blog.csdn.net/Sunny_Future/article/details/103209407