[Tutor] methods vs. functions

TheIrda theirda at gmail.com
Mon Aug 22 23:05:49 CEST 2011


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 concept is quite
different.
In the procedural programming you have the code that manipulare date to get
the result, while in OOP you have objects that act through methods to get
teh result.

At least this is my understanding :)

2011/8/22 Prasad, Ramit <ramit.prasad at jpmorgan.com>

> 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,
> Ramit
>
>
> Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
> 712 Main Street | Houston, TX 77002
> work phone: 713 - 216 - 5423
>
>
> This email is confidential and subject to important disclaimers and
> conditions including on offers for the purchase or sale of
> securities, accuracy and completeness of information, viruses,
> confidentiality, legal privilege, and legal entity disclaimers,
> available at http://www.jpmorgan.com/pages/disclosures/email.
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110822/07b750f3/attachment.html>


More information about the Tutor mailing list