I am using python 3.6.5 I want to input a variable which can take in name of the person with space. This is my code for it right now:
def addition():
with open('Directory.csv','a',newline='') as file:
w=csv.writer(file,delimiter=',')
def names():
name=input('Enter Name :')
n=0
for i in name:
if i.isalpha() or i.isspace():
n+=0
else:
n+=1
if n==0:
return name
else:
print('Error')
return names()
name=names()
But when I press enter without any value inputted, it still accepts it:
Enter Value of k : 2
Enter Name :
Enter Year of Birth :
What should be my code to correct this?