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