I am all new to python and I just got to know methods I am using python 3.7.0 64 bit and I want to know what is the difference between methods and functions. but please in very very basic explanation because I am also all new to programming.
Asked
Active
Viewed 56 times
0
-
Hi, Welcome to Stack Overflow , Did you search about functions and method , and also did you read the how to ask question in Stack Overflow? – ᴀʀᴍᴀɴ Jul 08 '18 at 17:21
-
1method = function defined in a class. – Aran-Fey Jul 08 '18 at 17:29
2 Answers
0
Let's have two examples len(), and list.sort() Here len() is called as function because it is invoked before declaring the object on which it is to be used. On the other hand, we would call sort as a method of list object.

Sanjay Anbu
- 55
- 1
- 4
0
The difference between methods and functions is that functions are declared in a class, whereas methods are declared in an object.