Control Flow: The for
Loops
Drawing a Dashed Circle
Having experimented with drawing a dashed line, you can modify the n-gon code to draw a circular pattern with dashes instead of a solid path:
import turtle
dashes = int(input("Please enter number of dashes: "))
for _ in range(dashes):
turtle.forward(15)
# Make a half turn by 180/dashes instead of 360/dashes
turtle.left(180 / dashes)
turtle.penup()
turtle.forward(5)
# Make another half turn to complete the actual turn (360/dashes) in this cycle
turtle.left(180 / dashes)
turtle.pendown()
turtle.done()