Two sum
Write two_sum(numbers, target) that returns the indices of the two numbers that add up to target, as a (i, j) with i < j. Assume exactly one answer exists. Aim for a single pass using a .
Examples
two_sum([2, 7, 11, 15], 9) → (0, 1)
Exercise
3 checksTwo sum
def two_sum(numbers, target):
...
print(two_sum([2, 7, 11, 15], 9))
Press Run to try your code, then Check answer to grade it.