Outline for October 15, 2020

Reading: §5.3, 5.4
Due: Homework 1, due October 15, 2020


  1. Ending a loop from inside [loopend.py]
    1. break causes program to fall out of loop immediately
    2. continue causes program to start loop over immediately

  2. Program: counting to 10 [toten.py]

  3. Program: print the odd numbers between 1 and 10 inclusive, skipping 3

    1. Use continue [odd1to10a.py]
    2. Use an if to enclose the body of the loop [odd1to10b.py]

  4. Program: sum the first 10 squares [sumsq.py]

  5. Program: Fibonacci numbers [fib.py]


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 16, 2020 at 12:15PM

You can also obtain a PDF version of this.

Valid HTML 4.01 Transitional Built with BBEdit Built on a Macintosh