Using the correction pointed out by @001,
angle = 360 / n_sides
your code correctly plots a hexagon.
To close the plot, click the Thonny stop icon.