APK errors

The ninth digit of a VÖEN cannot be calculated

The tax registration rule counts a VÖEN as ten digits. The first two digits are the territory. The next six digits are the serial number. The tax program sets the ninth digit with a special algorithm. The tenth digit is the status.

The algorithm is not published. A program cannot repair the ninth digit and cannot check it either. Do not write an invented formula.

0000000001 and 0000000002 on this page are not issued numbers. They are nobody's VÖEN. They only show the place of the last digit: 1 is a legal person, 2 is a natural person.

Some pages split the same ten digits as 2+5+1+2 and treat the last two digits as the status. The rule does not split it that way. The status is one digit, the tenth.

def forma(voen: str) -> str:
    metn = voen.replace(" ", "")
    if not (len(metn) == 10 and metn.isdigit()):
        raise ValueError("10 reqem")
    son = metn[9]
    if son == "1":
        return "huquqi"
    if son == "2":
        return "fiziki"
    raise ValueError("status")

# Verilməmiş nömrələrdir. Yalnız son rəqəmi göstərir.
print(forma("0000000001"))
print(forma("0000000002"))