Quiz Catalog

Catalog of quizzes

l = [[1, 2], [3, 4, 5]]
print(sum(l, []))
[1, 2, 3, 4, 5]
  • build-in/sum

lst = [3, 1, 2, 4, 1]

sum_of_num = sum(lst, start=2)

print(sum_of_num)
13
  • build-in/sum
  • list/literal