Python Turtle 畫圖程式碼樣例
python
四葉草-1
點選檢視程式碼
import turtle as t
from math import *
t.penup()
t.goto(0,20)
t.pendown()
t.setheading(-45)
t.pensize(10)
t.color('lightgreen')
for i in range(4):
t.forward(20*sqrt(2))
t.begin_fill()
t.circle(100,90)
t.left(90)
t.circle(100,90)
t.end_fill()
t.hideturtle()
t.done()