Why do the following lines give me the same result?
I tried to do the same with
list.append but got a
list.append takes two arguments - the list to modify and the element to append. So you need to do it like this:
ls =  list.append(ls, 2)
which is equivalent to the much more popular: