def is_sum_of_numbers(n, numbers):
    for i in numbers:
        if n - i in numbers:
            return True
return False
numbers = {2, 7, 8, 9}
is_sum_of_numbers(9, numbers)
is_sum_of_numbers(5, numbers)
is_sum_of_numbers(18, numbers)
How to check if N can be expressed as sum of two other numbers in specific list