Relative Content

Tag Archive for pythonlist-comprehension

How to improve a List Comprehension in python

I’m attempting to convert this function to a List Comprehension but I have to do a work around using set() to prevent False from repeating. And the locations are not in order. e.g. {0, 12, 5} instead of [0, 5, 12]. Can someone advise where I’m going wrong?