narenarya

Drawing circle with squares in python

May 6th, 2014
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. import turtle
  2. def draw_square(point):
  3.     for i in range(1,5):
  4.         point.forward(300)
  5.         point.right(90)
  6. def draw_circle(circ):
  7.     circ.circle(100)
  8. def draw_art():
  9.     window=turtle.Screen()
  10.     window.bgcolor('red')
  11.     #Drawing a circle projection
  12.     point=turtle.Turtle()
  13.     point.shape('turtle')
  14.     point.color('yellow')
  15.     for i in range(1,37):
  16.         draw_square(point)
  17.         point.right(10)
  18.     window.exitonclick()
  19. draw_art()
Advertisement
Add Comment
Please, Sign In to add comment