Last active
January 19, 2016 10:54
-
-
Save jorge-lavin/e98b9347595df56a106a to your computer and use it in GitHub Desktop.
Calcular Letra de Nif
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
# Fuente | |
# https://es.wikibooks.org/wiki/Algoritmo_para_obtener_la_letra_del_NIF#Python | |
def get_nif_letter(nif_numbers): | |
try: | |
return ("T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E")[nif_numbers%23] | |
except TypeError as e: | |
print(e) | |
print('Maybe you should pass the argument as a number') | |
raise | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment