Computer Science, asked by Destroyer5568, 1 year ago

Which is more fundamental between Python functions and Python object-methods?

Answers

Answered by saranyaammu3
0

Answer:

Python Method

Method is called by its name, but it is associated to an object (dependent).

A method is implicitly passed the object on which it is invoked.

It may or may not return any data.

A method can operate on the data (instance variables) that is contained by the corresponding class

Functions

Function is block of code that is also called by its name. (independent)

The function can have different parameters or may not have any at all. If any data (parameters) are passed, they are passed explicitly.

It may or may not return any data.

Function does not deal with Class and its instance concept.

Explanation:

Similar questions