OR is a condition that combines two boolean inputs:
A = B OR C
if they are both false, it evaluates to false. Otherwise, it evaluates to true.
So if either B or C is true, then A is true regardless of the value of the other.
So in your code:
for a in name:
if (a.isalpha() or a.isspace()) or (a.isalpha() and a.isspace()) and (name.isalpha() and name.isspace()):
...
return True
If the first character in the input is alphabetic, then your function returns True - it does not even look at any other characters and the loop is terminated.
Move the
return True
to after the loop, and simplify your condition: most of it is irrelevant!