Description
|
Program name
|
List of list: each list element consists
of a list.
|
|
A simple class definition for a 'client'
and the creation (instantiation) of an object of that class.
|
|
A class definition that includes method
definitions for the class.
|
|
An example illustrating the use of the
parameter that is passed into all methods 'self'
|
|
An example illustrating the use of the
initialization method '__init__'
|
|
The initialization method with default
parameters.
|
|
Module example: functions are divided among two modules |
modules.zip |
Module example: each class definition resides in it's own module |
modules2.zip |
(Extra example: not in the notes) how to
handle the case where a method of a class takes as a parameter an object of
that same class.
|
|
(Extra example: not in the notes) what is the purpose of the __str__ method. |
str.py |
Smorgasbord example: another one to illustrate: exception handling (this
time where the instruction that can cause the exception to be raised is not
a function call), a contrast of a function vs. method call. |
smorgasborg.py |