#叠加等边三角形.py import turtle turtle.penup() turtle.fd(-50) turtle.pendown() turtle.pensize(6) turtle.pencolor("black") turtle.seth(60) turtle.fd(300/2) for i in range(2): turtle.right(120) turtle.fd(300) turtle.right(120) turtle.fd(300/2) turtle.right(60) turtle.fd(300/2) for i in range(2): turtle.right(120) turtle.fd(300/2)
#正方形螺旋线.py import turtle turtle.setup(600,500,200,200) turtle.penup() turtle.fd(-220) turtle.pendown() turtle.pensize(5) turtle.pencolor("green") turtle.seth(60) turtle.fd(400*2/3) for i in range(2): turtle.right(120) turtle.fd(400) turtle.right(120) turtle.fd(400/3) turtle.left(60) turtle.fd(400/3) for i in range(2): turtle.right(120) turtle.fd(400) turtle.right(120) turtle.fd(400*2/3)
#无边正方形.py import turtle turtle.setup(600,400,200,200) turtle.pensize(5) turtle.pencolor("purple") turtle.pendown() turtle.fd(80) turtle.penup() turtle.seth(90) turtle.fd(10) turtle.pendown() turtle.fd(80) turtle.left(90) turtle.penup() turtle.fd(16) turtle.pendown() turtle.fd(60) turtle.penup() turtle.left(90) turtle.fd(10) turtle.pendown() turtle.fd(70)
#新蝰蛇.py import turtle turtle.setup(600,400,200,200) turtle.pensize(25) turtle.pencolor("purple") turtle.penup() turtle.fd(-250) turtle.pendown() turtle.seth(-40) for i in range(4): turtle.circle(40,80) turtle.circle(-40,80) turtle.circle(40,40) turtle.fd(40) turtle.circle(16,180) turtle.fd(40*2/3)