Lecture 5: October 10, 2019

Reading: §4
Due: Homework 1, due on October 10 at 11:59pm


  1. Greetings and felicitations!
  2. Functions [hello.py]
    1. What functions are
    2. Defining them
    3. Using them
  3. Quick look at using them [quad.py]
    1. Passing values to functions
    2. Returning values from functions
  4. In more detail: passing values to functions [args.py]
    1. Formal parameters in subject definition
    2. Actual parameters (arguments)
    3. Matching arguments to formal parameters
    4. Local variables
  5. In more detail: how Python does function calls [quad.py]
    1. Caller suspends execution at point of call, remembers where it left off
    2. Formal parameters assigned values from actual parameters
    3. Execute function body
    4. Return control to where caller left off

UC Davis sigil
Matt Bishop
Office: 2209 Watershed Sciences
Phone: +1 (530) 752-8060
Email: mabishop@ucdavis.edu
MISSING TITLE
Version of October 10, 2019 at 7:49PM

You can also obtain a PDF version of this.

Valid HTML 4.01 Transitional Built with BBEdit Built on a Macintosh