On 23/08/11 00:10, Robert Sjoblom wrote:
Can someone please explain the difference between methods and functions?
I'm sure if you go to Wikipedia you will get the correct computer
science distinctions, however in practical terms and limiting the
discussion to Python:
A function is a piece
> Can someone please explain the difference between methods and functions?
I've heard the explanation "A cow is an animal but an animal is not
necessarily a cow." used to describe the difference between methods
and functions (ie, all methods are functions, but not all functions
are methods). Obviou
On 8/22/11, Prasad, Ramit wrote:
> Steven D'Aprano wrote:
>>(Methods are very similar to functions. At the most basic level, we can
>>pretend that a method is just a function that comes stuck to something
>>else. Don't worry about methods for now.)
>
> Can someone please explain the difference bet
On Mon, Aug 22, 2011 at 3:11 PM, Prasad, Ramit wrote:
> Steven D'Aprano wrote:
> >(Methods are very similar to functions. At the most basic level, we can
> >pretend that a method is just a function that comes stuck to something
> >else. Don't worry about methods for now.)
>
> Can someone please ex
Well, my understanding is that function are used in procedural programmming
to make the code reusable, and to divide the bigger problem in a serie of
smaller ones.
Methods are used in OOP, and mainly are the actions taht objects can
perform.
Thay have a very similar syntax in python, but the conc
Steven D'Aprano wrote:
>(Methods are very similar to functions. At the most basic level, we can
>pretend that a method is just a function that comes stuck to something
>else. Don't worry about methods for now.)
Can someone please explain the difference between methods and functions?
Thanks,
Ra