Last active
January 8, 2019 12:37
-
-
Save rodabt/692668ec811a49ad33bf5b275a254fb6 to your computer and use it in GitHub Desktop.
Función de una línea para dígito verificador de RUT en Python
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
def dv(n): | |
return 'K' if (11-sum([int(j)*(i%6+2) for i,j in enumerate(str(n)[::-1])])%11)%11==10 else (11-sum([int(j)*(i%6+2) for i,j in enumerate(str(n)[::-1])])%11)%11 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment