Difference between Attribute and Method

Attribute:

A variable stored in an instance or class is called an attribute. Attributes are an object’s data, and methods are an object’s code. An object’s class defines which attributes and methods it will have.

Method:

A function stored in an instance or class is called a method. A function which is defined inside a class body. If called as an attribute of an instance of that class, the method will get the instance object as it’s the first argument.