Created
August 31, 2019 12:31
-
-
Save bergpb/92dc563ba80b4647cd078f44c7e26364 to your computer and use it in GitHub Desktop.
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
| import re | |
| class Pessoa(): | |
| @staticmethod | |
| def validaCpf(cpf): | |
| if (len(cpf) == 11) and (re.match('[0-9]+', cpf)): | |
| return True | |
| else: | |
| return False | |
| class Cadastro(): | |
| cpf = input('Entre com o cpf: ') | |
| print('Cpf recebido: {}'.format(cpf)) | |
| if(Pessoa.validaCpf(cpf)): | |
| print('Cpf válido') | |
| else: | |
| print('Cpf válido') | |
| Cadastro |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment