Skip to content

Latest commit

 

History

History
7 lines (5 loc) · 338 Bytes

File metadata and controls

7 lines (5 loc) · 338 Bytes

Given a list of integers, return a new list that consists of the sum of the first half of the original list. If the list has an odd length, include the middle character in the result.

For example:

  • sum_list([1, 2, 3, 4, 5])[6]
  • sum_list([67, 68, 69, 70])[135]
  • sum_list([12345, 54321, 13542])[66666]