Remove similar numbers in a list
<p>How do I remove numbers like 86.1 and 90.1 (or 86.2 and 90.2) from the following list?</p>

<pre><code>86.1      86.2       90.1      90.2
</code></pre>

<pre><code>inputList=[86.1, 86.2, 90.1, 90.2]

tolerance=1.0
out=[]
for num in inputList:
    if all([abs(num-outAlready)&gt;tolerance for outAlready in out]):
        out.append(num)

print out
</code></pre>

python list python-2.7