回答編集履歴
2
間違い
test
CHANGED
@@ -1,23 +1 @@
|
|
1
|
-
|
1
|
+
言語を間違いました。
|
2
|
-
|
3
|
-
from collections import Counter
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
l=[["red","apple",50],["blue","grape",110],["red","remon",20],["red","apple",100],["yellow","banana",30]]
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
counter = Counter()
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
for k,v,i in l:
|
16
|
-
|
17
|
-
counter[k,v] += int(i)
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
print(counter)
|
22
|
-
|
23
|
-
```
|
1
修正
test
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
```python
|
2
|
-
|
3
|
-
from operator import itemgetter
|
4
2
|
|
5
3
|
from collections import Counter
|
6
4
|
|