I've created a list in python,
list1 = [1,2,3,4]
and tried to append it tp itself,
list1.append(list1)
this is what i've got, it's kind of never ending! could someone please explain me what is happening?
>>> list1=[1,2,3,4]
>>> list1.append(list1)
>>> list1
[1, 2, 3, 4, [...]]
>>> len(list1)
5
>>> len(list1[4])
5
>>> print list1[4]
[1, 2, 3, 4, [...]]
>>> print list1[4][4]
[1, 2, 3, 4, [...]]
>>> print list1[4][4][4]
[1, 2, 3, 4, [...]]
>>> print list1[4][4][4][4]
[1, 2, 3, 4, [...]]
>>> print list1[4][4][4][4][4]
[1, 2, 3, 4, [...]]
>>> print list1[4][4][4][4][4][4]
[1, 2, 3, 4, [...]]
>>> print list1[4][4][4][4][4][4][4]
[1, 2, 3, 4, [...]]
>>> print list1[4][4][4][4][4][4][4][4]
[1, 2, 3, 4, [...]]
>>> print list1[4][4][4][4][4][4][4][4][4]
[1, 2, 3, 4, [...]]
that's never ending. Thank You