Outline for October 15, 2020
Reading
: §5.3, 5.4
Due
: Homework 1, due October 15, 2020
Ending a loop from inside [
loopend.py
]
break
causes program to fall out of loop immediately
continue
causes program to start loop over immediately
Program: counting to 10 [
toten.py
]
Program: print the odd numbers between 1 and 10 inclusive, skipping 3
Use
continue
[
odd1to10a.py
]
Use an
if
to enclose the body of the loop [
odd1to10b.py
]
Program: sum the first 10 squares [
sumsq.py
]
Program: Fibonacci numbers [
fib.py
]
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.