change any() to list comprehension