I am new to python program. the below code has some error with list.

```
len = []

def collatz_length(n,count):
                ++count
                if len[n]:
                        return len[n]
                if n == 1:
                        len[n] = count
                elif n & 1:
                        len[n] = count + collatz_length(3 * n + 1,0)
                else:
                        len[n] = count + collatz_length(n >> 1,0)

                return len[n]

print collatz_length(13,0)

```

i am trying to figure out the length.But the gives error

**OUTPUT**

```
Traceback (most recent call last):
  File "collatz.py", line 21, in <module>
    print collatz_length(13,0)
  File "collatz.py", line 9, in collatz_length
    if len[n]:
IndexError: list index out of range

```