Skip to content

Instantly share code, notes, and snippets.

@amyghotra
Last active August 8, 2016 19:13
Show Gist options
  • Save amyghotra/c5795cd803e5b1c2a7dfce71f63b397e to your computer and use it in GitHub Desktop.
Save amyghotra/c5795cd803e5b1c2a7dfce71f63b397e to your computer and use it in GitHub Desktop.
Create a simple figure.
from turtle import *
def polygon(number_of_sides, side_length, color):
penup()
forward(2)
pencolor(color)
pendown()
for i in range (6):
forward(2)
right(360/ number_of_sides)
for i in range (6):
forward(side_length)
right(360/ number_of_sides)
polygon(6, 50,"yellow")
getscreen()._root.mainloop()
@amyghotra
Copy link
Author

pygameshape

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment