# Author: James Tam # Version: November 13, 2024 # Learning concepts: understanding the need for the reference name when inside # outside the methods of a class. class Person: def __init__(self,aName): self.name = aName def sayName(self): print("My name is...", self.name) def start(): stacey = Person("Stacey") jamie = Person("Jamie") #Prefacing with a reference name makes it clear which object is accesed. print(stacey.name) print(jamie.name) #But even if there is only one reference or many references a reference name #is still needed. #JT's hint for figuring this out, remember/review my scoping rules frome #the functional/decompostion section. # #When referring to an identifier: #1) Check for the creation of that idenifier in the local scope #2) If nothing local then check for the creation of the identifier globally. print("What would the output be? Why?") print(name) start()