# Commits

committed 63be16c

• Participants

# File poker.py

`     cards = [13,13,1,10,9]`
`     return cards`
` `
`+`
`+# 手札を同じ数のカードでグルーピングし辞書を作成する`
`+# 引数: 手札のリスト(cards)`
`+# 返り値: 手札をグルーピングした辞書: card_dict`
`+# テスト: 辞書のvalueの合計が5になる事`
`+# 変数: num_of_cards`
`+# `
`+#def grouping_cards(cards):`
`+`
`+`
`+`
` def is_one_pair(cards):`
`     card_dict = {}`
`     for card in cards:`

# File test_poker.py

`         self.assertEqual(False, is_two_pair(four_cards))`
` `
` `
`+    def test_grouping_cards(cards):`
`+        # `
`+        #no_pair = [9,10,11,12,13]`
`+        #self.assertEqual(dict, type(grouping_cards(no_pair)))`
`+`
`+        num_of_cards = 0`
`+        for values card_dict.values():`
`+            num_of_cards += values`
`+`
`+        no_pair = [9,10,11,12,13]`
`+        self.assertEqual(5, grouping_cards(no_pair))`
`+`
`+        one_pair = [13,9,13,11,12]`
`+        self.assertEqual(5, grouping_cards(one_pair))`
`+`
`+        two_pair = [13,13,10,11,10]`
`+        self.assertEqual(5, grouping_cards(two_pair))`
`+`
`+        three_cards = [13,13,13,11,12]`
`+        self.assertEqual(5, grouping_cards(three_cards))`
`+`
`+        four_cards = [13,13,13,13,12]`
`+        self.assertEqual(5, grouping_cards(four_cards))`
`+`
`+`
` if __name__ == '__main__':`
`     unittest.main()`
` `