← Back to challenges

Sum of Even Pairs in List

PythonHarddata_structuresmatharrays

Instructions

Given a list with an even amount of numbers, return True if the sum of two numbers in the list is even and False if the sum of two numbers in the list is odd.

To illustrate:

11, 15, 6, 8, 9, 10
  • 11 + 15 = 26 = True
  • 15 + 6 = 21 = False
  • 6 + 8 = 14 = True

Examples

odd_sum_list([11, 15, 6, 8, 9, 10]) ➞ [True, False, True, False, False]

odd_sum_list([12, 21, 5, 9, 65, 32]) ➞ [False, True, True, True, False]

oddSumArr([1, 2, 3, 4, 5, 6]) ➞ [False, False, False, False, False]

Notes

  • Remember that the length of all the lists will be an even number, so it is not necessary to measure lengths.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Clear the Fog