Thursday, 19 September 2013

Cannot append list to a list?

Cannot append list to a list?

I can't find this question elsewhere on StackOverflow, or maybe my
researching skills are not advanced enough, so I am asking now:
So I was playing around with Python today after not having touched it in a
while and I found that the following snippet of code does not work:
>>> list1 = [1,2,3]
>>> list2 = [4,5,6]
>>> list3 = list1.append(list2)
>>> list3
Why does the last line not produce any results?
Also, I'm using Python 2.7.3, if that makes any difference

No comments:

Post a Comment