Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

nested loop

def something(a):
    for methodname in ['method1', 'method2', 'method3']:
        try:
            m = getattr(a, methodname)
        except AttributeError:
            pass
        else:
            return m()
    raise AttributeError
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #nested #loop
ADD COMMENT
Topic
Name
7+8 =