Python newbie here, I am trying to create a simple login function that checks if the user's input is more than 3 characters and that it also doesn't contain a number.
The function does sort of work, because while if the user enters less than 3 characters it prints 'Your name must be more than 3 characters'.
What I can't figure out is how to check if the user enters a number then print 'Must not contain numbers'.
def login_function():
print('****************************************')
user_name = ""
while len(user_name) <= 3:
user_name = input('Please enter your name: ')
print('Your name must be more than 3 characters')
return user_name
login_function()
I have tried using str(input('')) to make sure that the user only enters a character. I have also tried if else but it ended up quite messy.