Draw the following figure with python turtle

Dennis Podbicanin 96 Reputation points
2020-05-22T10:45:42.563+00:00

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.

Figure: 8496-download.png

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,170 questions
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful