From 7e0e1723d02e864c563d5bcd1baf515f10a321bd Mon Sep 17 00:00:00 2001 From: "clement.bruley" Date: Mon, 25 Apr 2022 19:12:58 +0200 Subject: [PATCH] ADD : write the function check_for_sum --- main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 614cfb9..ea70786 100644 --- a/main.py +++ b/main.py @@ -11,7 +11,13 @@ """ def check_for_sum(the_array, the_sum_value): - ##### ------ YOUR CODE ------ ##### + length_array = len(the_array) + + for i in range (0, length_array): + for j in range (i, length_array): + if (the_array[i] + the_array[j]) == the_sum_value: + return True + return False