confused about adding elements to a list with list.append(otherlist)

Tist Verdonck tist.verdonck at
Mon Aug 13 12:41:24 CEST 2001

I got this problem where I have an empty list and I want to fill it up 
with other lists using a for-iteration:

list = []
data = ['ab','cd','de','ef','gh']
z = len(data)
for x in range(z):

my goal was to get the follwing value for list:

what I got is this:

I think it must have something to do with me having problems with
python's use of variables (not copying them but making references to them)

could somebody please help me out?

Tist Verdonck
tist.verdonck at

More information about the Python-list mailing list