How to remove elements from list when each character is identical (Python)?
<pre><code>sample = ['AAAA','ABCB','CCCC','DDEF']
</code></pre>

<p>I need to eliminate all elements where every character is identical to itself in the element eg. AAAAA,CCCCC</p>

<pre><code>output = ['ABCB','DDEF']

sample1 =[]
for i in sample:
    for j in i:
       if j == j+1:    #This needs to be corrected to if all elements in i identical to each other i.e. if all "j's" are the same
        sample1.pop(i)
</code></pre>

<p>print sample</p>

<pre><code>sample = ['AAAA','ABCB','CCCC','DDEF']

sample1 = []
for i in sample:
    if len(set(i)) &gt; 1:
        sample1.append(i)
</code></pre>

python for-loop