# Author: James Tam # Version: November 12, 2024 # Learning concepts: understanding the need for self when inside the methods # of a class. class Person: def __init__(self): self.name = "No name" #Stylistic benefit of self. #Clarifying whose method is being called. def makeBesties(self,bestie): self.myBestie = bestie bestie.myBestie = self def start(): stacey = Person() jamie = Person() jamie.name = "Jamie Smythe" stacey.name = "Stacey Hearn" #Make jamie and stacey each other's besties stacey.makeBesties(jamie) #Display Stacey's name and the name of Stacey's bestie print("%s, %s" %(stacey.name,stacey.myBestie.name)) start()