Staircase challenge - Python
I have a few suggestions for you:


You should get in the habit on wrapping all code that isn't in a function in a main guard, to ensure that that code only runs if that file is running, and to protect it from import mishaps
Running your code with pylint, a few warnings that popped up were:


Returns: All return statements should return something or none of them should return anything. Since you are returning permutations, the other return's should just return None.
Module Docstring: Your function should contain a docstring describing what the function does, even if it's very obvious. These will help any documentation.
Constant variable names: Since the three variables in the main guard do not change, they should be in all UPPERCASE to make it clear that they are constants.



Refactored code:

def valid_moves(position, target, legal, path, permutations):
    """ Returns unique ways to climb a staircase with passed length `target` """
    if position &gt; target:
        return None
    if position == target:
        permutations.append(path)
        return None
    for move in legal:
        valid_moves(position + move, target, legal, path + [move], permutations)
    return permutations

if __name__ == '__main__':
    START = 0
    STAIRCASE_LENGTH = 3
    LEGAL_MOVES = [1, 2]

    print(*valid_moves(START, STAIRCASE_LENGTH, LEGAL_MOVES, [], []), sep="\n")