title: Removing duplicate elements in place from a list of sorted integers
body: <p>I want to remove duplicate elements from a list and return the list that has only unique values. Here is my code</p>
  
  <pre><code>def remove_dup(nums):
      for i in range(1, len(nums)):
          if nums[i] == nums[i-1]:
              nums.remove(nums[i])
      return nums
  </code></pre>
  
  <p>I am testing the code with this :</p>
  
  <pre><code>print(remove_dup([0,0,1,1,1,2,2,3,3,3,4]))
  </code></pre>
  
  <p>I was expecting the output to be [1,2,3,4] but I am getting [0, 1, 1, 2, 3, 3, 4]. Can anyone please explain, why? </p>