Python Class Composition
Python Object Oriented Programming. Association describes relationships between classes. Under association, we have aggregation, and composition.
Aggregation implies a relationship where a class can exist independently of another class. Composition implies a relationship where a class cannot exist independently of another class. In this video, we cover the idea of composition, where a class is created and used only within another class. Thus, this relationship is class A OWNS class B. The idea differs from inheritance, where class A IS class B, if A inherits from B.
Source Code:
https://github.com/ImKennyYip/python-oop
Python Object Oriented Programming Playlist:
• Python Object Oriented Programming
Python Data Structures and Algorithms Playlist:
• Python Data Structures and Algorithms
Python Game Programming Projects Playlist:
• Python Game Programming Tutorial
Subscribe for more coding tutorials 😄 !
Other Videos By Kenny Yip Coding
2025-04-22 | Pygame Tutorial 7 - Friction |
2025-04-08 | Pygame Tutorial 6 - Jumping |
2025-04-07 | Pygame Tutorial 5 - Game Boundaries |
2025-04-04 | Pygame Tutorial 4 - Drawing Images |
2025-04-02 | Pygame Tutorial 3 - Keyboard Input |
2025-03-31 | Pygame Tutorial 2 - Drawing and Graphics |
2025-03-31 | Pygame Tutorial 1 - Create a Game Window |
2025-03-31 | How to Install Pygame |
2025-03-21 | Python Nested Classes (Inner Class) |
2025-03-20 | Python Class Aggregation |
2025-03-19 | Python Class Composition |
2025-03-18 | Python Abstract Class and Abstract Method |
2025-03-17 | Python Method Resolution Order / MRO, Super, and Diamond Inheritance Problem |
2025-03-16 | Python Multiple Inheritance |
2025-03-15 | Python Multilevel Inheritance |
2025-03-13 | Python super() Function |
2025-03-12 | Python Inheritance |
2025-03-11 | Python Duck Typing |
2025-03-10 | Python Class Variables |
2025-03-09 | Sorting Classes in Python |
2025-03-08 | Python Dunder Methods mul vs rmul |