title: Python: Iterate through list and remove duplicates (without using Set())
body: <p>So I have a list:</p>
  
  <pre><code>s = ['cat','dog','cat','mouse','dog']
  </code></pre>
  
  <p>And I want to be able to iterate through the list and remove the duplicates, WITHOUT using the set() function! So for example it should remove 'cat' and position s[2] BUT keep 'cat' at position s[0]. It then needs to do the same thing for 'dog', ie. keep 'dog' at position s[1] but remove 'dog' from position s[4].</p>
  
  <p>So the output is then:</p>
  
  <pre><code>s = ['cat','dog','mouse']
  </code></pre>
  
  <p>I have tried to use i and j as index positions in the list, and check whether the element at position i is equal to the element at position j. If so, it will remove it and increment the value of j by 1, if not then it will leave it and just increment the value of j. After the whole list has been iterated through, it will increment the value of i and then check the whole list again, for the new element. Below:</p>
  
  <pre><code>i = 0
  j = 1
  for a in range(len(s)):
      for b in range(len(s)):
          if s[i] == s[j]:
              s.remove(s[j])
              j = j + 1
          else:
              j = j + 1
      i = i + 1
  </code></pre>
  
  <p>What am I doing wrong here?</p>