What is a method attribute, and a data attribute? What the difference between them and what they have in common?
I was reading python 2.7.9 (https://docs.python.org/
An attribute is any thing for the lack of a better word that is bound to an object, for example:
class Dog:
def __init__(self):
self.name = "Rufus"
def bark(self):
print "Woof Woof!"
In this case the data attribute is the name, which is simply a value that is bound to the instance of the Dog. As for a method attribute, one answer would be the bark method, as it's not so much a value as it is an action. It's just as it is in English. A data attribute is exactly as it sounds; it's data, it is simply a property. A method is a procedure, an action, and this is exactly what a method attribute is.