def company_vat_checksum(digits):
    """
    Calculates and returns a control digit for given list of digits basing on NIP standard.
    """
    weights_for_check_digit = [6, 5, 7, 2, 3, 4, 5, 6, 7]
    check_digit = 0

    for i in range(0, 9):
        check_digit += weights_for_check_digit[i] * digits[i]

    check_digit %= 11

    return check_digit
Calculates and returns a control digit for given list of digits basing on NIP standard.