how do i make an array global

Georg Brandl g.brandl-nospam at gmx.net
Wed Jun 28 09:52:13 EDT 2006


Erik Max Francis wrote:
> a wrote:
> 
>> def fn():
>>      for i in range(l)
>>            global count
>>            count[i]= ....
>> 
>> how do i declare count to be global if it is an array
> 
> 	count = [...]
> 
> 	def fn():
> 	    global count
> 	    for i in range(l):
> 	        count[i] = ...
> 

No need for "global" here.

Georg



More information about the Python-list mailing list