[Tutor] declaring list in python

Logesh Pillay logesh at iafrica.com
Wed Jan 11 06:28:01 CET 2006


Hello list

I want to declare a list of a specific size as global to some nested
function like so

def foo (n):
	A[] (of size n)
	def foo1 
		...

The only way I can think to declare the list is to use dummy values:
	A = [0] * n

A = [] * n doesn't work.  [] * n = []

I'd prefer not to use dummy values I have no use for.  Is there any way?

Thanks

Logesh Pillay




More information about the Tutor mailing list