From 23f68fee3ade3e7ce0a5ea0a620a40640c789731 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Sun, 5 Jan 2020 14:38:31 +0200 Subject: [PATCH] Update filter_unique.md --- snippets/filter_unique.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/snippets/filter_unique.md b/snippets/filter_unique.md index 7632cd494..5cc3ed8f8 100644 --- a/snippets/filter_unique.md +++ b/snippets/filter_unique.md @@ -12,8 +12,7 @@ Use list comprehension to create a list containing only the non-unique values. from collections import Counter def filter_unique(lst): - counter = Counter(lst) - return [item for item, count in counter.items() if count > 1] + return [item for item, count in Counter(lst).items() if count > 1] ``` ```py