I have this program:
word = input('Customer Name: ')
def validateCustomerName(word):
while True:
if all(x.isalpha() or x.isspace() for x in word):
return True
else:
print('invalid name')
return False
validateCustomerName(word)
I want the program to repeat to ask the user to input their name if their name is entered wrongly such as if it has numbered in it. Return True if the name is valid and False for invalid
output:
Customer Name: joe 123
invalid name
expected output:
Customer Name: joe 123
invalid name
Customer Name: joe han
>>>
Am I missing something in the program?...Thanks