Access a function variable outside the function without using “global”
I am trying to access a local function variable outside the function in Python. So, for example,
I am trying to access a local function variable outside the function in Python. So, for example,
I’m new to Python, so this is probably a simple scoping question. The following code in a Python file (module) is confusing me slightly:
locals is a built in function that returns a dictionary of local values. The documentation says: