title: My loop seems to be working differently with different asserts?
body: <p>I'm new to coding, and I'm working through the exercises on checkio.org, this one is called 'remove all before'. The idea is that given a list of numbers, you're supposed to remove all elements in the list before a certain number. Here's the given code:</p>
  <pre><code>def remove_all_before(items: list, border: int):
      #your code here
      
      
  if __name__ == '__main__':
      print(&quot;Example:&quot;)
      print(list(remove_all_before([1, 2, 3, 4, 5], 3)))
      
      assert list(remove_all_before([1, 2, 3, 4, 5], 3)) == [3, 4, 5]
      assert list(remove_all_before([1, 1, 2, 2, 3, 3], 2)) == [2, 2, 3, 3]
      assert list(remove_all_before([1, 1, 2, 4, 2, 3, 4], 2)) == [2, 4, 2, 3, 4]
      assert list(remove_all_before([1, 1, 5, 6, 7], 2)) == [1, 1, 5, 6, 7]
      assert list(remove_all_before([], 0)) == []
      assert list(remove_all_before([7, 7, 7, 7, 7, 7, 7, 7, 7], 7)) == [7, 7, 7, 7, 7, 7, 7, 7, 7]
  </code></pre>
  <p>So far, I've tried filling in the function with a few different variations of the following loop:</p>
  <pre><code>if items == []:
          return items
      for i in items:
          if i == border:
              items = items[i::]       #also tried items = items[i-1::]
              print(items)
          elif i!=border:
              continue
          return items
  </code></pre>
  <p>For some reason, the asserts seem to be returning different indices of my list. For example, using 'items = items[i-1::]' will correctly return [3, 4, 5] for the first assert, but for the second it returns [1, 2, 2, 3, 3] instead of [2, 2, 3, 3] like it should.
  In contrast, using 'items = items[i::]' returns [4, 5] instead of [3, 4, 5]. What am I missing here?</p>