Files
python/reference/concepts/class_composition.md

6 lines
341 B
Markdown
Raw Normal View History

# Class composition (vs inheritance)
TODO: ADD MORE
- adding functionality from a class by incorporating an instance of that class in a class you are creating. The example creates a `robot` by instantiating a `compass` and assigning it to the `self`.compass attribute of `robot`. [robot-simulator](../exercise-concepts/robot-simulator.md)