Created
December 9, 2015 00:54
-
-
Save sahilsinha/51214caec8fefdc7cff9 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
import turtle | |
def drawPolygon (the_turtle,num_side): | |
angle = 360 / num_side | |
for iter in range (num_side): | |
are_we_fizz = iter + 1 | |
print are_we_fizz | |
if are_we_fizz % 3 == 0 and are_we_fizz % 5 == 0: | |
the_turtle.color('blue') | |
print 'FizzBuzz' | |
elif are_we_fizz % 3 == 0: | |
the_turtle.color('red') | |
print 'Fizz' | |
elif are_we_fizz % 5 == 0: | |
the_turtle.color('green') | |
print 'Buzz' | |
the_turtle.forward (100) | |
the_turtle.left (angle) | |
def main(): | |
turtle.setup (800, 800, 0, 0) | |
myturtle = turtle.Turtle() | |
sides = 30 | |
drawPolygon(myturtle,sides) | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment