Question: PYTHON 3 ** USE RECURSION ** Use no for loops or comprehensions (which include for loops) in your code. Do not call the min or
PYTHON 3 **USE RECURSION **Use no for loops or comprehensions (which include for loops) in your code. Do not call the min or max or sorted functions or the sort method on lists. If you use local variables, each can be assigned a value only once in a call, and it cannot be re-assigned or mutated; try to use no local variables (except where they are mentioned in hints). Of course, do not mutate any parameters. 1. Define a recursive function named is_sorted; it is passed a list of values that can be compared (e.g., all int or all str) it returns a bool telling whether or not the values in the list are in non-descending order: lowest to highest, allowing repetitions. For example, is_sorted([1,1,2,3]) returns True; but is_sorted([1,2,3,1]) returns False. Hint: my solution had a base case including any list that doesnt have at least two values to compare against each other.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
