How to iterate a list while deleting items from list using range() funtion?
<p>This is the most common problem I face while trying to learn programming in python. The problem is, when I try to iterate a list using "range()" function to check if given item in list meets given condition and if yes then to delete it, it will always give "IndexError". So, is there a particular way to do this without using any other intermediate list or "while" statement? Below is an eg.:</p>

<pre><code>l = range(20)
for i in range(0,len(l)):
  if l[i] == something:
    l.pop(i)
</code></pre>
