2
votes

Why does print [1].append(2) evaluate to None? I expect [1,2]

>>> print [1].append(2)
None
2

2 Answers

9
votes

That's because append returns nothing (= None).

>>> print [1].append(2)
None
3
votes

array.append doesn't return the array you appended to, it returns None.