Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
f = lambda lista: len(lista) == True
i = 0
def corrigirNome(nome):
nome=nome.strip()
prondliga=['dos','das']
prondliga2=['de','do','da']
if len(nome) > 3:
l = [i for i in range(len(nome)) if nome[i] in '0123456789']
if f(l) == True:
print('Não pode conter numeros')
if i+1 < len(nome):
if nome[i+1] == ' ' and nome[i+2] != ' ' and nome[i+2:i+5] not in prondliga and nome[i+2:i+4] not in prondliga2:
nome = nome[0:i+2]+nome[i+2].upper()+nome[i+3:]
nome=nome[0].upper()+nome[1:]
return nome
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment