天天看點

python之turtle畫圓形和正方形

import turtle as t

t.begin_fill()

t.circle(10)

t.title(“正方形和圓形”)

t.fillcolor("#069")

for x in range(4):

t.forward(20)

t.right(90)

t.end_fill()

t.hideturtle()

t.done()