confusion because i can't figure out what is changing the attribute of the object of a class in python
confusion because i can't figure out what is changing the attribute of the object of a class in python Question: Here is my code ` class Cats: def __init__(self,name): self.name=name #print(self.name,name,"hello") def change_name(self,new_name): self.name=new_name return 0 #print(new_name) cat1=Cats("lion") print(cat1) print(cat1.name) cat2=cat1.change_name("tiger") print(cat1.name) print(cat1) print(cat2) ** Here is the output with my comments/opinion on the side …