猫史档案馆


怎样用海龟编辑器画圆

用户:半生梦寐半生梦寐查看:0 回复:0 评论:0 创建时间:2021-07-13T21:59:33


import turtle

bob = turtle.Turtle()   # Creating the object "bob"

def draw_circle(t):
    for i in range (360):   # Loop for drawing a circle
        t.fd(1) # Draw a line with the length of 1 pixel in the forward direction
        t.lt(1) # Turn 1 degree to the left

draw_circle(bob)
turtle.mainloop()


回复

上一页1 页 / 共 0下一页