Nested functions. : Nested function : Function PYTHON TUTORIALS


PYTHON TUTORIALS » Function » Nested function »

 

Nested functions.


def outer():

   def inner():
      print "nFunction inner executing"
      print "The objects in inner's scope are:", dir()
      print "Function inner finishing"

   print "Function outer executing"
   print "The objects in outer's scope are:", dir()
   inner()
   print "nFunction outer finishing"

print "The objects in the global scope are:"
print dir()

print "nCalling function outern"
outer()
print "nFunction outer finished"



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Function
» Nested function