Question: Create a recursive function in a file called ascending.py: def ascending ( current _ list, start = 0 ) : An ascending list ( non

Create a recursive function in a file called ascending.py:
def ascending(current_list, start=0):
An ascending list (non-strict in our case) will be considered any list which does not decrease as you scan through the indices.
[1,2,3,4,10,20,100] is ascending as is [2,10,1000,1001,5000,5050].
Another ascending list is [1,1,1,1,1,1,1] since none of the elements descend. This means we are using the notion of a non-strictly increasing list.
However, a list like [1,2,3,4,5,3] or a list like [1,4,2,5,3,6,4,7,8] would not be considered ascending.
Write a recursive function that only looks at one element of the list during any recursive call. Do not use a loop inside of your function.
The start=0 means that 0 is the smallest possible number in our list, so our function will be only for lists of non-negative numbers. Start is not meant to be an index.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!