Last active
August 24, 2021 04:02
-
-
Save marcuxyz/2dfa65124016426e169b296832a09b41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://edabit.com/challenge/G9QRtAGXb9Cu368Pw | |
from unittest import TestCase | |
from combination import combinations | |
class CombinationTest(TestCase): | |
def test_combination(self): | |
self.assertEqual(combinations(2), 2) | |
self.assertEqual(combinations(2, 3), 6) | |
self.assertEqual(combinations(3, 5), 15) | |
self.assertEqual(combinations(5, 6, 7), 210) | |
self.assertEqual(combinations(5, 5, 5, 5), 625) | |
self.assertEqual(combinations(3, 6, 9), 162) | |
self.assertEqual(combinations(2, 3, 4, 5, 6, 7, 8, 9, 10), 3628800) | |
self.assertEqual(combinations(4, 5, 6), 120) | |
self.assertEqual(combinations(5, 6, 7, 8), 1680) | |
self.assertEqual(combinations(6, 7, 0), 42) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from unittest import TestCase | |
from number_string import number_string | |
class NumberStringTest(TestCase): | |
def test_combination(self): | |
self.assertEqual(number_string(['abc', 'abc10']), ['abc10']) | |
self.assertEqual(number_string(['abc', 'ab10c', 'a10bc', 'bcd']),['ab10c', 'a10bc']) | |
self.assertEqual(number_string(['1', 'a' , ' ' ,'b']), ['1']) | |
self.assertEqual(number_string(['rct', 'ABC', 'Test', 'xYz']), []) | |
self.assertEqual(number_string(['this IS','10xYZ', 'xy2K77', 'Z1K2W0', 'xYz']), ['10xYZ', 'xy2K77', 'Z1K2W0']) | |
self.assertEqual(number_string(['-/>', '10bc', 'abc ']), ['10bc']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment