[Tutor] order loop from methos on class

Steven D'Aprano steve at pearwood.info
Mon Jan 26 12:04:40 CET 2015


On Mon, Jan 26, 2015 at 11:48:52AM +0100, jarod_v6 at libero.it wrote:
> 
> 
> Dear All,
> What is the best way to loop on methos on a class?

I do not understand the question. Can you explain in more detail?


> class Rna():
>     def trim():
>         ...
>     def align():
>         ...

Both methods need a "self" parameter:

    def trim(self):
        ...
    def align(self):
        ...


> ena = Rna()
> ena.trim()
> ena.aling()

ena.align()



-- 
Steve


More information about the Tutor mailing list