Created
May 3, 2017 03:48
-
-
Save nasturtus/858bfa81cb98c00f12b6cf8664469922 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://greenteapress.com/thinkpython2/html/thinkpython2005.html | |
import turtle | |
def polygon(t, n, length): | |
angle = 360 / n | |
for i in range(n): | |
t.fd(length) | |
t.lt(angle) | |
bob = turtle.Turtle() | |
polygon(t=bob, n=8, length=100) # keyword arguments for greater readibility | |
turtle.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment