-
filter_non_unique30 seconds of Code 2022. 2. 8. 23:46
내가 푼 것
from collections import Counter def fnu(lst): counter = Counter(lst) nl = [] for u in counter: if counter[u] == 1 : nl.append(u) print(nl)>>>
fnu([1,2,2,3,4,4,5]) #[1,3,5]제공하는 답
print([item for item, count in Counter(lst).items() if count == 1]반응형'30 seconds of Code' 카테고리의 다른 글
#20 in_range (0) 2022.02.08 has_duplicates (0) 2022.02.08 왼손코딩 1일1파이썬 9,10,11,12 (0) 2022.02.04 [python]count_occurrences /degrees_to_rads/*difference (0) 2022.02.04 파이썬 join, os.path.join (0) 2022.02.03