It depends on what you want to do. append adds to the outermost list, but you can append to a nested list by indexing it: a[-1].append(3) appends 3 to the last sublist of a.
–
Andrew JaffeMay 15 '14 at 11:27

Mikola has the right answer but a little more explanation. It will run the first time, but because append returns None, after the first iteration of the for loop, your assignment will cause list1 to equal None and therefore the error is thrown on the second iteration.

Like Mikola said, append() returns a void, so every iteration you're setting list1 to a nonetype because append is returning a nonetype. On the next iteration, list1 is null so you're trying to call the append method of a null. Nulls don't have methods, hence your error.