# Author: James Tam # Version: October 21, 2014 # Learning concepts # * Objects are accessed through references # * The reference and the object are separate in memory. class Person: age = 0 name = "none" def __init__(self,newAge,newName): self.age = newAge self.name = newName def displayAge(aPerson): print("%s age %d" %(aPerson.name,aPerson.age)) def start(): person1 = Person(13,"Person2") person2 = person1 person2.age = 888 displayAge(person1) displayAge(person2) print() person1 = Person(666,"Person1") displayAge(person1) displayAge(person2) start()