Appending item to lists - python
- by ariel
I have a list lets say a=[[1,2],[3,4],[5,6]]. I want to add to each item in a the char 'a'.
when I use a=[x.append('a') for x in a] it return [None,None,None]. But if I use a1=[x.append('a') for x in a] then it do someting odd. a and not a1 is [[1,2,a],[3,4,a],[5,6,a]]. I don't understand why the first return [None, None, None] nor why the second works on a.