title: Remove certain consecutive duplicates in list
body: <p>I have a list of strings like this:</p>
  
  <pre><code>['**', 'foo', '*', 'bar', 'bar', '**', '**', 'baz']
  </code></pre>
  
  <p>I want to replace the <code>'**', '**'</code> with a single <code>'**'</code>, but leave <code>'bar', 'bar'</code> intact. I.e. replace any consecutive number of <code>'**'</code> with a single one. My current code looks like this:</p>
  
  <pre><code>p = ['**', 'foo', '*', 'bar', 'bar', '**', '**', 'baz']
  np = [p[0]]
  for pi in range(1,len(p)):
    if p[pi] == '**' and np[-1] == '**':
      continue
    np.append(p[pi])
  </code></pre>
  
  <p>Is there any more pythonic way to do this?</p>