回答編集履歴

1

例を追加

2021/12/22 14:52

投稿

ppaul
ppaul

スコア24670

test CHANGED
@@ -3,3 +3,17 @@
3
3
 
4
4
 
5
5
  [class collections.Counter([iterable-or-mapping])](https://docs.python.org/ja/3/library/collections.html#collections.Counter)です。
6
+
7
+
8
+
9
+
10
+
11
+ ```python
12
+
13
+ >>> from collections import Counter
14
+
15
+ >>> print(Counter(["数学", "音楽", "美術", "体育", "数学", "美術", "数学"]))
16
+
17
+ Counter({'数学': 3, '美術': 2, '音楽': 1, '体育': 1})
18
+
19
+ ```