Hello, I have to draw the following figure with turtle in python. I have achieved the following:
import turtle turtle.speed(25) length = 30 turtle.x = 25 turtle.y = 25 def draw_rhombus(): for i in range(1, 3): turtle.forward(length) turtle.left(180 - 130) turtle.forward(length) turtle.left(130) def draw_octagon(d): for i in range(8): turtle.forward(d) turtle.right(360/8) for i in range(7): draw_rhombus() turtle.right(50) turtle.right(35) for i in range(7): draw_rhombus() turtle.right(50) turtle.penup() turtle.forward(80) turtle.pendown() turtle.right(110) draw_octagon(60) turtle.mainloop()
But I can't draw the second octagon. Can you help me?
Please excuse the wrong Q&A tag because I couldn't find one for the Python programming language.