示例#1
0
def view_combos():
    print('Printing out the card combinations in the deck.')
    _str = ''
    _str += "Calculating different possibilities for combinations in a standard 52-card deck:"
    for i in range(1, 52):
        _str += '{} card: {} combos.\n'.format(i, combos.n_choose_k(52, i))
    print(_str)
    pause()
示例#2
0
 def test_nchoosek_3pick2_returns3(self):
     expected = 3
     result = combos.n_choose_k(3, 2)
     self.assertEqual(expected, result)
示例#3
0
 def test_nchoosek_2pick1_returns1(self):
     expected = 2
     result = combos.n_choose_k(2, 1)
     self.assertEqual(expected, result)