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 validate_cpf(cpf): | |
| validate = lambda cpf: sum([a*b for a, b in zip(map(int, list(cpf)), range(1, 10, 1))]) % 11 | |
| first_digit = validate(cpf) | |
| second_digit = validate(cpf[1:-1]) | |
| return int(cpf[-2]) == first_digit and int(cpf[-1]) == second_digit |
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
| javascript:window.location='http://tools.folha.com.br/print?site=emcimadahora&url='+document.URL |