How do i validate a user input in python ? I am writing this code , the user has to put in their name, and it has to be two names separated by a space and the name should contain only letters
def Name():
n = 0
name = input('name please\n>>')
c = name.split(' ')
while len(c) != 2:
print('we need two names')
name = input('name please\n>>')
c = name.split(' ')
while True:
for i in name:
if i not in r:
n+=1
if n > 0:
print('Letters only')
else:
break
Name()