# circle ``` # ch31_6.py import turtle t = turtle.Pen() t.speed(0) #t.color('blue') t.penup() #將筆提起: 移動時不畫線 t.setheading(180) #海龜往左 t.forward(150) #移動往左 #t.setheading(0) #海龜往右 t.pendown() t.circle(50) #畫右下 t.circle(-50) #畫右上 t.forward(100) t.circle(50) #畫左下 t.circle(-50) #畫左上 step = 5 # 每次增加距離 for r in range(10, 100+step, step): t.penup() # 將筆提起 t.setpos(150, -100) # 海龜到點(150,100) t.setheading(0) t.pendown() # 將筆放下準備繪製 t.circle(r, 90 + r*2) # 繪製圓 turtle.done() ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up