Commits

Go Yamada committed c208ad4

add test_grouping_cards

  • Participants
  • Parent commits 63be16c

Comments (0)

Files changed (1)

 # テスト: 辞書のvalueの合計が5になる事
 # 変数: num_of_cards
 # 
-#def grouping_cards(cards):
-
+def grouping_cards(cards):
+    card_dict = {}
+    for card in cards:
+        if card in card_dict:
+            card_dict[card] += 1
+        else:
+            card_dict[card] = 1
 
 
 def is_one_pair(cards):