def test_contains_digit(self):
     self.assertFalse(contains_digit(123, 4))
     self.assertTrue(contains_digit(42, 2))
     self.assertTrue(contains_digit(1000, 0))
     self.assertFalse(contains_digit(12346789, 5))
def contains_digits(number, digits):
    for num in digits:
        if not contains_digit(number, num):
            return False
    return True
def contains_digits(number, digits):
    for num in digits:
        if not contains_digit(number, num):
            return False
    return True
Ejemplo n.º 4
0
def contains_digits(number, digits):
    result = True
    for dig in digits:
        if not contains_digit(number, dig):
            return False
    return result
def contains_digits(number, digits):
    for dig in digits:
        if not contains_digit(str(number), dig):
            return False
    return True
def contains_digits(number, digits):
    result = True
    for digit in digits:
        if not cd.contains_digit(number, str(digit)):
            return False
    return result
Ejemplo n.º 7
0
def contains_digits(number, digits):
    contained = list(filter(lambda x: contains_digit(number, x), digits))
    return len(digits) == len(contained)
def contains_digits(number, digits):
    for i in digits:
        dig = contains_digit(number, i)
        if not dig:
            return False
    return True
Ejemplo n.º 9
0
def contains_digits(number, digits):
    for i in range(len(digits)):
        if not contains_digit(number, digits[i]):
            return False
    return True
 def test_two(self):
     self.assertTrue(contains_digit(42, 2))
 def test_one(self):
     self.assertFalse(contains_digit(123, 4))
 def test_four(self):
     self.assertFalse(contains_digit(12346789, 5))
 def test_three(self):
     self.assertTrue(contains_digit(1000, 0))
Ejemplo n.º 14
0
def contains_digits(number, digits):
    for dig in digits:
        if not contains_digit(str(number), dig):
            return False
    return True