"ast" <nom...@invalid.com> a écrit dans le message de 
news:56defc8e$0$3341$426a7...@news.free.fr...
Hello

lst = [(1,2,3), (4, 5,6)]
sum(lst, ())
(1, 2, 3, 4, 5, 6)

Any explanations ?
thx

OK, sorry, I finally understand.
This is because adding tuple (or list or string ...) is a concatenation

() + (1,2,3) + (4, 5,6)
(1,2,3,4,5,6)

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to