Python Reading
- There is no new reading for today.
Key Ideas
- Terminology: One class can inherit the state variables and methods
from another class. This is known as inheritance.
- For example, the class student is a subclass of person.
For example, the class teacher is a subclass of person.
In-Class Activity
- The program dungeons.py illustrates
the concept of inheritance in the context of Dungeons and Dragons.
Make sure you fully understand this example.
- Draw a picture of the inheritance hierarchy.
Active Learning
- Modify the Dungeons and Dragons program to enable another
character type (such as an elf or a dwarf) to be created.
Test your program to make sure that it works properly.
- Add appropriate comments to the program. Ask MacKenzie or John
to check that you have done so in an appropriate manner.
- Make an additional interesting enhancement to the program.