Understanding Objects as Values
• 5 is an instance of an int. So is 6.
They behave differently when we use them.
• xs=[1,2,3] and ys=[4,5] both refer to lists
→ but contain different data.
→ The same methods are available on each list (such as
append, extend, sort, etc), but they respond differently
→ If we modify one, the other is not affected.
→ we're only discussing values here (not aliases)
• two Person objects are both instances of the Person class.
→ They may have different names, ages, etc.
→ have same methods (b/c each is a Person).
Each object is an instance of its class type.