Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python program to demonstrate scoping

# Python program showing
# a scope of object
 
def some_func():
    print("Inside some_func")
    def some_inner_func():
        var = 10
        print("Inside inner function, value of var:",var)
    some_inner_func()
    print("Try printing var from outer function: ",var)
some_func()
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #python #program #demonstrate #scoping
ADD COMMENT
Topic
Name
1+8 =