input()
returns a string, always, but you are testing against integers. Make them strings:
if choice in ('1', "move"):
return 1
Your entered choice
doesn't match any of your tests, so the function ends without ever reaching an explicit return
statement and Python reverts to the default return value of None
.
Better still, replace the whole if/elif/elif
tree with a dictionary:
choices = {
'1': 1,
'move': 1,
# ...
'4': 4,
'quit': 4,
}
if choice in choices:
return choices[choice]
else:
print('No such choice!')