python check if any element in list meets condition