I have this function that should return 1 once the input is 'x'. Why does this return None if the first input is 'y' and then the next input is 'x'?
def func():
a = input('x or y\n')
if a == 'x':
return 1
else:
func()
print(func())
This is written in the command line:
x or y
y # My input
x or y
x # My input
None
Why does it return None and not 1?