1. 程式人生 > >turtle庫繪製奧運五環

turtle庫繪製奧運五環

點選檢視視訊

import turtle

turtle.pensize(10)
turtle.color("blue") #定義顏色
turtle.penup() #penup和pendown()設定畫筆擡起或放下時是否繪製直線
turtle.goto(-110,-25) #初始位置以中心座標為(0,0)
turtle.pendown()
turtle.circle(45) #繪製圓的半徑

turtle.pensize(10)
turtle.color("black")
turtle.penup()
turtle.goto(0,-25)
turtle.pendown()
turtle.circle(
45) turtle.pensize(10) turtle.color("red") turtle.penup() turtle.goto(110,-25) turtle.pendown() turtle.circle(45) turtle.pensize(10) turtle.color("yellow") turtle.penup() turtle.goto(-55,-75) turtle.pendown() turtle.circle(45) turtle.pensize(10) turtle.color("green") turtle.penup() turtle.goto(55,-75) turtle.pendown() turtle.circle(
45)