def m():
m1 = input()
m1.lower()
if m1 in ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']:
return m1
else:
m()
f= m()
Here, value of f updates as long as if statement is executed, when else is executed which calls the function itself. So, when the second time if is executed(after else) the value of f is not updating and giving out "none"