Question: The language is python def count_stair_ways(n): def repeat(): if : return else: return return Q6: Count Stairs You want to go up a flight of
The language is python

def count_stair_ways(n): def repeat(): if : return else: return return
Q6: Count Stairs You want to go up a flight of stairs that has n steps. You can either take 1 or 2 steps each time. How many different ways can you go up this flight of stairs? Write a function count_stair_ways that solves this problem. Assume n is positive. Before we start, what's the base case for this question? What is the simplest input? What do count_stair_ways(n - 1) and count_stair_ways(n - 2) represent? Use those two recursive calls to write the recursive case
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
