-
Skim-read Sec 10.2.2-10.2.3 (Object-oriented programming and Python classes, pg 330-332)
-
Try the magic methods
__getitem__
and__add__
for the familiarint
andlist
classes by typing out the boxed Sessions 10.1 and 10.2 on pages 331-332. -
Skim-read Sec 10.3.1-10.3.3 (the constructor method, accessor methods, and mutator methods, pg 333-339)
-
Try out creating the Planet class by typing out Listing 10.1 and Session 10.3 on page 334.
On Friday before spring break (Week 7 Friday), we went over:
- creating a file with new data,
- basic usage of
.format
(not explained in our textbook, so you have to go read the worksheet), - and reviewing reading lines from a file.
If you did not finish the worksheet please go over it here:
Date: March 23, 2017 Reference: Miller and Ranum 2nd edition Section 5.2, starting page 155.
- Download the following plain text file http://mcs177.github.io/labs/rainfall.txt and save it in your current directory. If you are using the MCS lab computer, save this in the Documents folder. This file contains the total annual rainfall (in inches) for 25 towns in Iowa.