what is the difference between methods and functions in Python

theritically, i want to know the differences

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

In Python, a function is a standalone block of code that performs a task and can be called independently, while a method is a function that is associated with an object or class and is called using that object (like obj.method()). In short, all methods are functions, but not all functions are methods—methods are tied to objects, whereas functions are not.

Python

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