A method is a function that “belongs to” an object. (In Python, the term method is not unique to class instances: other object types can have methods as well . For example, list objects have methods called append, insert, remove, sort, and so on.
A method is a function that “belongs to” an object. (In Python, the term method is not unique to class instances: other object types can have methods as well . For example, list objects have methods called append, insert, remove, sort, and so on.