Forward References : def « Function « Python Tutorial






def bar():
    print 'in bar()'

def foo():
   print 'in foo()'
   bar()

foo()

# In fact, we can even declare foo() before bar():
def foo():
    print 'in foo()'
    bar()

def bar():
    print 'in bar()'

foo()








10.1.def
10.1.1.def Statement
10.1.2.Forward References
10.1.3.Function Attributes
10.1.4.create an inner function
10.1.5.Creating and using a programmer-defined function.
10.1.6.Finding the maximum of three integers.
10.1.7.Nested function design
10.1.8.defs and lambdas do the same sort of work