0

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.

ᴀʀᴍᴀɴ
  • 4,443
  • 8
  • 37
  • 57

2 Answers2

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.