...

/

Solution Review: Check Sum

Solution Review: Check Sum

This lesson provides the solution to the check sum exercise.

We'll cover the following...

Solution #

Press + to interact
def check_sum(num_list, num):
for first_num in range(len(num_list)):
for second_num in range(first_num + 1, len(num_list)):
if num_list[first_num] + num_list[second_num] == num:
return True
return False
num_list = [10, -14, 26, 5, -3, 13, -5]
print (check_sum(num_list, -8))
...