usrbinenv python3 leetcdoe no 70 climbing stairs distinct ways to climb a numberofsteps staircase where each time you can either climb 1 or 2 steps args numberofsteps number of steps on the staircase returns distinct ways to climb a numberofsteps staircase raises assertionerror numberofsteps not positive integer climbstairs3 3 climbstairs1 1 climbstairs7 doctest ellipsis traceback most recent call last assertionerror numberofsteps needs to be positive integer your input 7 usr bin env python3 leetcdoe no 70 climbing stairs distinct ways to climb a number_of_steps staircase where each time you can either climb 1 or 2 steps args number_of_steps number of steps on the staircase returns distinct ways to climb a number_of_steps staircase raises assertionerror number_of_steps not positive integer climb_stairs 3 3 climb_stairs 1 1 climb_stairs 7 doctest ellipsis traceback most recent call last assertionerror number_of_steps needs to be positive integer your input 7
def climb_stairs(number_of_steps: int) -> int:
    
    assert (
        isinstance(number_of_steps, int) and number_of_steps > 0
    ), f"number_of_steps needs to be positive integer, your input {number_of_steps}"
    if number_of_steps == 1:
        return 1
    previous, current = 1, 1
    for _ in range(number_of_steps - 1):
        current, previous = current + previous, current
    return current


if __name__ == "__main__":
    import doctest

    doctest.testmod()