PythonUncategorized

23Gon using Turtle- Python

[sourcecode language=”python” wraplines=”false” collapse=”false”]
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 16 00:28:29 2016

@author: Deepak
"""

#Program will draw 23-gon using turtle

import turtle

t = turtle.Pen()
num_sides= 23
side_length = 30
myangle = 360 / num_sides

for i in range(num_sides):
t.forward(side_length)
t.right(myangle)
[/sourcecode]