Skip to content

Instantly share code, notes, and snippets.

@bergpb
Created August 31, 2019 12:31
Show Gist options
  • Select an option

  • Save bergpb/92dc563ba80b4647cd078f44c7e26364 to your computer and use it in GitHub Desktop.

Select an option

Save bergpb/92dc563ba80b4647cd078f44c7e26364 to your computer and use it in GitHub Desktop.
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