Question: I'm trying to get one array out of several arrays in python 2.7

I found on the internet that this is done simply by adding both lists:

```
lista = [1,2,3]
listb = [3,4,5]
listc = lista + listb

```

In my case my first list i empty and the next list has 99 elements. 

My code looks like this

```
data_complete = []
for i in range(1, numberOfFiles+1):
    data = getDataFromFile(i)
    data_complete = data_complete + data

```

The last line of code does not work, it returns the error:

```
data_complete = data_complete + data
ValueError: operands could not be broadcast together with shapes (0) (99)

```

I would be glad if someone can solve this.

Kind Regards

Answer: 
It looks like `getDataFromFile` is returning a numpy array, rather than a list. In this case, `+` will use the *array's* concatenation routine, which has some extra requirements compared to `list`s (and returns another array). You can use the list `extend` method instead to get around this:

```
data_complete = []
for i in range(1, numberOfFiles+1):
    data = getDataFromFile(i)
    data_complete.extend(data)

```
just `append` the data to your list 

for example:

```
evens = []
for i in xrange(10):
    if i%2 == 0:
        evens.append(i)

```

at the end of this program `evens` will equal `[2,4,6,8]`