:::

Empty Title

#畫烏龜

inport turtle

window = turtle.Screen()

babbage = turtle.Turtle()

babbage.left(90)

babbage.forward(100)

babbage.right(90)

babbage.circle(10)

window.exitonClick()

--畫第一個花瓣----

inport turtle

window = turtle.Screen()

babbage = turtle.Turtle()

babbage.left(90)

babbage.forward(100)

babbage.right(90)

babbage.circle(10)

babbage.left(15)

babbage.forward(50)

babbage.left(157)

babbage.forward(50)

window.exitonClick()

--畫第二個花瓣----

inport turtle

window = turtle.Screen()

babbage = turtle.Turtle()

babbage.left(90)

babbage.forward(100)

babbage.right(90)

babbage.circle(10)

babbage.left(15)

babbage.forward(50)

babbage.left(157)

babbage.forward(50)

babbage.left(15)

babbage.forward(50)

babbage.left(157)

babbage.forward(50)

window.exitonClick()

---用For迴圈---

import turtle #create window and turtle

window = turtle.Screen()

babbage = turtle.Turtle() #draw stem and centre babbage.left(90)

babbage.forward(100)

babbage.right(90)

babbage.circle(10)

for i in range(2):

    babbage.left(15)

    babbage.forward(50)

    babbage.left(157)

    babbage.forward(50)

#tidy up window window.exitonclick()


:::
http%3A%2F%2Fkang.phjh.hlc.edu.tw%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbdsn%3D5%26tbsn%3D3