3 ms·
It does if you specify a sequence of list as the first argument, and an empty list as an initial value.
by nine_k 9y ago
It does if you specify a sequence of list as the first argument, and an empty list as an initial value.
- vostok 9y agoThis is because the start argument defaults to 0. It doesn't make sense to add a list and 0. The same thing does not work for a sequence of strings and an empty string. sum(["abc","def"], "") Throws TypeError: sum() can't sum strings [use ''.join(seq) instead]