Exemplo n.º 1
0
def minus_last(num: int) -> int:
    """
    the sum of all the divisors except itself
    :param num: int numbers
    :return:  int sum of all the divisors except itself (num)
    """
    sum_div = 0
    list_minus = divisor(num)
    list_minus.remove(num)
    for i in list_minus:
        sum_div = sum_div + i
    return sum_div
Exemplo n.º 2
0
def test_07_task_227_divisor():
    with pytest.raises(TypeError):
        divisor((8, ))
Exemplo n.º 3
0
def test_06_task_227_divisor():
    with pytest.raises(TypeError):
        divisor({
            6,
        })
Exemplo n.º 4
0
def test_05_task_227_divisor():
    with pytest.raises(TypeError):
        divisor([8])
Exemplo n.º 5
0
def test_04_task_227_divisor():
    with pytest.raises(TypeError):
        divisor({4: 1})
Exemplo n.º 6
0
def test_02_task_227_divisor():
    with pytest.raises(TypeError):
        divisor('abc')
Exemplo n.º 7
0
def test_01_task_227_divisor():
    assert divisor(6) == [1, 2, 3, 6]