Draws a regular polygon
from math import * from turtle import * # initialization s=60 n=int(input("# of sides? ")) # angle a=180*(n-2)/n # set color numworks k=-1 l=['blue','red','green','orange','purple'] while k<0 or k>4: print("Choose Color") print("0. blue") print("1. red") print("2. green") print("3. orange") print("4. purple") k=int(input()) col=l[k] # setup penup() left(180) forward(60) left(90) forward(60) left(90) # draw the polygon pendown() color(col) for i in range(n): if n>6: forward(s/2) else: forward(s) left(180-a)