If we denote the answer to n stairs as C(n).

Then C(1) = 1 (only 1 way to climb 1 stair) C(2) = 2 (1 stair + 1
stair or 2 stairs at a time) 
If your final choice is 1 stair, then C(n) is reduced to C(n1) and 2
stairs will reduce C(n) to C(n2). 
So we see that C(n) = C(n1) + C(n2) because your final choice is
either 1 stair or 2 stairs.
Code below.
class Solution(object):
C = {1:1, 2:2}
def climbStairs(self, n):
"""
:type n: int
:rtype: int
"""
if n in Solution.C:
return Solution.C[n]
else:
result = Solution.C.get(n1, self.climbStairs(n1)) + \
Solution.C.get(n2,self.climbStairs(n2))
Solution.C[n] = result
return result