Skip to main content

Draw polygon in polygons (regular polygons)

This is my code that draws regular polygons:

import turtle

tr = turtle.Turtle()

tr.lt(150)
for x in range(3,13):
    for i in range(x):
        tr.fd(80)
        tr.lt(360//x)

turtle.done()

This is my output: actual output

But my expected output is: expected output

Can you help me?



source https://stackoverflow.com/questions/74810152/draw-polygon-in-polygons-regular-polygons

Comments