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()
  • 奧運五環
    在這裏插入圖片描述
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章