The precise trouble has now been solved in former answers, so I'll deal with the general idea of using conditionals inside of list comprehensions.The values just before and following the assigned slice are going to be stored, and the collection will shrink or improve to incorporate the new values:language specialised (of a language) applying inf