Created
August 18, 2011 19:20
-
-
Save revolunet/1154911 to your computer and use it in GitHub Desktop.
Valider un numéro de sécurité sociale [INSEE] en Python
This file contains hidden or 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 validInsee(insee, cle): | |
# http://fr.wikipedia.org/wiki/Numero_de_Securite_sociale#Unicit.C3.A9 | |
# gestion numeros corses | |
insee = insee.replace('A', 0) | |
insee = insee.replace('B', 0) | |
reste = int(insee) % 97 | |
return ((97 - reste) == int(cle)) |
JeromeHoen
commented
Jan 17, 2023
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment