turtle基礎練習
阿新 • • 發佈:2017-09-08
同心圓 port bsp right goto rtl down end yellow
同切圓
>>> import turtle
>>> turtle.circle(50)
>>> turtle.circle(70)
同心圓
import turtle
>>> turtle.circle(100)
>>> turtle.up()
>>> turtle.goto(0,-100)
>>> turtle.down()
>>> turtle.circle(200)
五角星
import turtle
>>> turtle.forward(90)
>>> turtle.right(144)
>>> turtle.forward(90)
>>> turtle.right(144)
>>> turtle.forward(90)
>>> turtle.right(144)
>>> turtle.forward(90)
>>> turtle.right(144)
>>> turtle.forward(90)
黃色的五角星
import turtle
turtle.color(‘yellow‘)
turtle.begin_fill()
turtle.fillcolor(‘yellow‘)
turtle.forward(90)
turtle.right(144)
turtle.forward(90)
turtle.right(144)
turtle.forward(90)
turtle.right(144)
turtle.forward(90)
turtle.right(144)
turtle.forward(90)
turtle.end_fill()
turtle基礎練習