[Tutor] How sum() works in python

Steven D'Aprano steve at pearwood.info
Tue Aug 1 20:56:08 EDT 2017


On Mon, Jul 31, 2017 at 11:06:18PM -0700, ramakrishna reddy wrote:

> > sum([[1,2,3], [3,4,5]], []) returns [1, 2, 3, 3, 4, 5]

[] + [1,2,3] + [3,4,5]

returns [1, 2, 3, 3, 4, 5].


-- 
Steve


More information about the Tutor mailing list