Outline for October 4, 2022

Reading: §5.4, 6.11
Assignments: Homework 1, due October 5, 2022


  1. Program: Fibonacci numbers [fib.py]

  2. Output [printing.py]
    1. Printing without format
    2. Printing with format using %
    3. Printing with format using format method

  3. import statement
    1. import math [hypotnoex.py]
    2. Need the “math.” before “sqrt”
    3. from math import sqrt [hypotnoex1.py]
    4. Do not need the “math.” before “sqrt”
    5. Now add in exception handling [hypotex.py]

  4. Full version of the hypotenuse program [pythag1.py]

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

  6. Quick look at using them [quad.py]

  7. Add error checking: “quad.py” done right [quad-c.py]


UC Davis sigil
Matt Bishop
Office: 2209 Watershed Sciences
Phone: +1 (530) 752-8060
Email: mabishop@ucdavis.edu
MHI 289I, Programming in Health Informatics
Version of October 4, 2022 at 4:13PM

You can also obtain a PDF version of this.

Valid HTML 4.01 Transitional Built with BBEdit Built on a Macintosh