[EMAIL PROTECTED] a écrit : > On Dec 12, 11:33 pm, Steven D'Aprano <[EMAIL PROTECTED] > cybersource.com.au> wrote: (snip) > > When you say python automatically allocates memory, what would you do > if you don't know the size of the list
thelist = [] thelist.append('Ever') thelist.append('bothered') thelist.append('reading') thelist.append('the') thelist.append('fine') thelist.append('manual') thelist.append('?') print thelist > of, say for example, the > nearest pairs between the two groups. I would probably iterate over > all the pairs and create a new list. I did a similar operation in > another program, but I had to initialize the list (statically) with x > = [0]*50 before I could use it in the for loop. You'd be better learning how to properly use lists and iterations in Python... While you're at it, add list comprehensions, iterators/generators and itertools to the list (pun intented). HTH -- http://mail.python.org/mailman/listinfo/python-list