what is the difference between methods and functions in Python

theritically, i want to know the differences

  • Rama
  • 15 Aug
  • 1500 Views
  • 37 Answers
Your Answer

A function is a block of code that performs a specific task and is defined using def. It is independent and not tied to any object or class. A method is a function that is associated with an object or class. It is called on an object and can access or modify the object’s data

Python

Didn't get the answer.
Contact people of Talent-Python directly by clicking here