title: How can I get a sum from some elements of a list?
body: <p>I have two list of elements:</p>
  <pre><code>p1_test = [10,5,7]
  board_test = [4,7,3,9]
  </code></pre>
  <p>I have to take one element from p1_test and check if there is a chance of sum 15 with the elements of board_test. From p1_test only can take one element, from board_test it could take the elements that were necessary.</p>
  <p>I've tried to create a function that returns True if I can sum 15</p>
  <pre><code>def chance_get_15():
  
      for a in p1_test:
          board_sum = a
          for b in board_test:
              board_sum += b
              if board_sum == 15:
                  print('there is a chance')
                  return True
              elif board_sum &gt; 15:
                  board_sum = board_sum - b
                  continue
  </code></pre>
  <p>If I run that, It doesn't return True. I want this to return True because, if I take the second element of p1_test (5) and sum with the second and the third element of board_test (7 and 3) it should return True. But I have not been able to translate that into python code.</p>
  <p>The list board_test is a variable list, it could have more or less elements, depend on the situation.</p>