drawPython
1 # drawSnake 2 import turtle 3 def drawSnake(rad,angle,len,neckrad): 4 for i in range(len): 5 turtle.circle(rad,angle) 6 turtle.circle(-rad,angle) 7 turtle.circle(rad,angle/2) 8 turtle.fd(rad) 9 turtle.circle(neckrad+1,180) 10 turtle.fd(rad*2/3) 11 12 def main(): 13 turtle.setup(1300,800,0,0) 14 pythonsize=30 15 turtle.pensize(pythonsize) 16 turtle.pencolor("blue") 17 turtle.seth(-40) 18 drawSnake(40,80,5,pythonsize/2) 19 20 main()
效果如下: