Can global variable be passed into Python function?
On 2/21/14 9:47 PM, Dennis Lee Bieber wrote:
> On Fri, 21 Feb 2014 09:59:17 -0800, Travis Griggs <travisgriggs at gmail.com>
> declaimed the following:
>> On Feb 21, 2014, at 4:13 AM, Ned Batchelder <ned at nedbatchelder.com> wrote:
>> Thank you!
>> I get tired of the ?Python doesn?t have variables? line.
> If one is coming from the world where "variable" means "name
> identifying a fixed location in memory" then Python does not have
> BASIC, C, FORTRAN, COBOL, Assembly... A "variable" is synonym for an
> address [a box that holds things].
> Even Python's mutable types (list, dictionary, for example) do not
> follow the "fixed location" metaphor. Each cell in a list merely references
> some object, and assignment to that cell changes the reference, not the
So we agree: variables in Python work differently than they do in those
If one is coming from the world where "variable" means "name bound to a
value", then Python does have "variables".
"variable" is a name bound to a value.
Ned Batchelder, http://nedbatchelder.com