I'm trying to do so that when I insert my name it checks if it has numbers in it (success) and if the name is to long. And once I type the name again it checks it all again. it works with checking the numbers, but it doesn't work with checking if it's to long. Instead, it just continues the code.
print('Hi! Whats your name?')
def nome():
global pontos
def hasNumbers(nomezito):
return any(char.isdigit() for char in nomezito)
print(nome + 'has numbers')
def longName(longevidade):
return len(nome) < 3 or len(nome) > 13
nome = input().title()
number = hasNumbers(nome)
long = longName(nome)
while number == True or long == True:
if number == True:
print('A name cant have any numbers. Please tell me your real name')
nome = input().title()
number = hasNumbers(nome)
continue
elif long == True:
print('Your name is too long to be real. Please tell me your real name.')
print(longName(nome))
nome = input().title()
long = longName(nome)
continue
P.S: I translated it from portuguese to english so you can read it better, but I might have made some mistakes. nome()