Reference: YEAR 13, PROGRAMMING WITH OBJECTS AND GRAPHICAL USER INTERFACES Student Workbook in Python
WRITTEN BY Karen Gray, Tom Harper, Sandy Garner, Anthony RobinsDepartment of Computer Science University of OtagoThe underlying principle of OOP is that data that belong together should be stored together in an object. Up to now you maintained relationships between pieces of data by using parallel lists. Remember the egg orders program?
Think of a stationery shop storing stock items eg pencils, pens, erasers, staplers and rulers in a list. They have another list which store the stock prices. An accidental mismatch is a real possibility. Now imagine using more lists to store shelf location, cost price of items etc. It can rapidly become very hard to manage.
It is a better idea to store the stock item and stock prices together so they don't become detached.
Thinking like a Computer Scientist (Chapter - Classes and Objects - the Basics)