1. 程式人生 > >奧運五環繪圖

奧運五環繪圖

import turtle #呼叫turtle繪相簿
turtle.color("blue") #設定筆觸顏色為藍色
turtle.circle(100) #畫一個直徑為100的圓
turtle.penup() #擡起筆觸
turtle.goto(-200,0) #移動到(-200,0)座標點
turtle.pendown() #放下筆觸
turtle.color("red")
turtle.circle(100)
turtle.penup()
turtle.goto(200,0)
turtle.pendown()
turtle.color("green")
turtle.circle(100)
turtle.penup()
turtle.goto(-100,-100)
turtle.pendown()
turtle.color("black")
turtle.circle(100)
turtle.penup()
turtle.goto(100,-100)
turtle.pendown()
turtle.color("yellow")
turtle.circle(100)
turtle.done() #設定完成後終止