Outline for October 20, 2020

Reading: §4
Due: Homework 2, due October 29, 2020

  1. Functions [hello.py]
    1. What functions are
    2. Defining them
    3. Using them

  2. Quick look at using them [quad.py]
    1. Passing values to functions
    2. Returning values from functions

  3. 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

  4. 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
MHI 289I, Programming for Health Informatics
Version of October 20, 2020 at 4:19PM

You can also obtain a PDF version of this.

Valid HTML 4.01 Transitional Built with BBEdit Built on a Macintosh