5 + 7  # 12 
4 * 6  # 24
8 / 3  # 2 (integer division)
8 % 3  # 2 (remainder)
8 % 2  # 0

# import library and create Turtle object
from turtle import Pen as Turtle
t = Turtle()

# move him around in a square
t.forward(50)
t.left(90)
t.forward(50)
t.left(90)
t.forward(50)
t.left(90)
t.forward(50)
t.left(90)

# make a method that draws a (larger) square
def mySquare():
  t.forward(75)
  t.left(90)
  t.forward(75)
  t.left(90)
  t.forward(75)
  t.left(90)
  t.forward(75)
  t.left(90)

# invoke it
mySquare()

# a method that draws a square
# with sides of length s,
# where s is a passed parameter
def square(s):
  t.forward(s)
  t.left(90)
  t.forward(s)
  t.left(90)
  t.forward(s)
  t.left(90)
  t.forward(s)
  t.left(90)

# fun with our new square function
square(4)
square(60)
t.left(180)
square(60)
t.left(90)
t.forward(200)

# python has a range command
range(1,10)
range(0,10)

# draw 10 squares, arranged at
# equal angles of the compass
for i in range(0,10):
  t.left(36)
  square(60)

# generalize to allow an
# arbitrary number of squares
# (given by param. petals)
# with arbitrary side length
def flower (petals, length):
  for i in range(0, petals):
    t.left(360.0/petals)
    square(length)

# some playing after class
t.forward(200)
flower(7,80)
t.forward(150)
flower(5,20)
t.forward(50)
flower(3,10)

# don't ask "where is the 'any' key?"
raw_input("Type any key to end ")
