import turtle
t = turtle.Turtle()
turtle.forward(1000)
t.speed(10)
t.width(5)
# first circle
t.circle(40)

# move to second circle
t.penup()
t.forward(80)
t.pendown()

t.circle(40)

# main vertical line + curve
t.right(90)
t.forward(160)
t.circle(-40, 180)
t.forward(160)

# return to middle
t.penup()
t.backward(160)
t.right(90)
t.pendown()

# small square-ish shape at the end
t.forward(40)
t.right(90)
t.forward(40)

t.penup()
t.backward(40)
t.left(90)
t.pendown()

t.forward(40)
turtle.done()