Class attribute name
When i write an attribute and later put = and the same name nothing happens, but when i change the self.attribute name but not the variable assigned and later create an object and print that specific attribute of the object, it prints out. But when i change the name of the variable assigned, it shows me an error. class Cat: def __init__(self, color, legs): self.color = color self.legs = legs felix = Cat("ginger", 4) print(felix.color) it works, later when i change color to colotr it works: class Cat: def __init__(self, color, legs): self.colotr = color self.legs = legs felix = Cat("ginger", 4) print(felix.colotr) but when i change the name it says name "colotr is not defined": class Cat: def __init__(self, color, legs): self.color = colotr self.legs = legs felix = Cat("ginger", 4) print(felix.color)