Outline for April 10, 2014

Reading: text, § 3
Due: April 17, 2014
  1. import statement
    1. import math [hypotnoex1.py]
    2. Need the “math.” before “sqrt”
    3. from math import sqrt [hypotnoex.py]
    4. Do not need the “math.” before “sqrt”
  2. Turtle graphics
    1. What turtle is; import turtle
  3. Drawing a figure: a box with a hat [tbox.py]
    1. Set up the window to draw in: Screen()
    2. Create the turtle: Turtle
    3. Cursor for drawing
    4. Move cursor forward: forward, backward()
    5. Turn cursor: left(), right()
    6. Wait for the window to close: mainloop()
  4. Titles, background, and such [tfancybox.py]
    1. Window
      1. Color of the window background: background()
      2. Title of the window: title
    2. Turtle, more properly called “pen”
      1. Shape of the turtle: shape()
      2. Speed of the drawing: speed()
      3. Color of the drawn line: color()
      4. Thickness of the line (pixels): pensize()
      5. Hide the turtle: hideturtle()
  5. Plotting points and graphing
    1. Drawing lines: penup(), pendown()
    2. Move turtle: setpos()
    3. Write text: write()
    4. Draw a dot at the current position: dot() [tchaosdots.py]
    5. Draw a line from the current position to another: goto() [tchaosline.py]
  6. Functions [hello.py]
    1. What functions are
    2. Defining them
    3. Using them
  7. Quick look at using them [quad.py]
    1. Passing values to functions
    2. Returning values from functions
  8. The right way to do quad.py [quad-c.py]


You can also obtain a PDF version of this. Version of April 10, 2014 at 4:18PM