A cleaner/shorter way to solve this problem?
<p>This exercise is taken from <a href="http://code.google.com/intl/de-DE/edu/languages/google-python-class/index.html" rel="nofollow">Google's Python Class</a>:</p>

<blockquote>
  <p>D. Given a list of numbers, return a list where
  all adjacent == elements have been reduced to a single element,
  so [1, 2, 2, 3] returns [1, 2, 3]. You may create a new list or
  modify the passed in list.</p>
</blockquote>

<p>Here's my solution so far:</p>

<pre><code>def remove_adjacent(nums):
  if not nums:
    return nums

  list = [nums[0]]

  for num in nums[1:]:
    if num != list[-1]:
        list.append(num)

  return list
</code></pre>

<p>But this looks more like a C program than a Python script, and I have a feeling this can be done much more elegant.</p>

<p><strong>EDIT</strong></p>

<p>So <code>[1, 2, 2, 3]</code> should give <code>[1, 2, 3]</code> and <code>[1, 2, 3, 3, 2]</code> should give <code>[1, 2, 3, 2]</code></p>
