Question: 4 Write a function that determines whether a list of numbers is sorted or not. Start with the following code. You should not need to
4 Write a function that determines whether a list of numbers is sorted or not. Start with the following code. You should not need to modify any of the existing code given to you, just add the function that checks for a sorted list. # TODO: define a function called 'issorted, that can be used to determine whether or not the list of items is in order # this function should return either 'True' or 'False' # NOTE: you should not modify any of the code below this line items [1, 3, 6, 3, 2, 6, 8, 9,9, 2,0, 3, 5] result isSorted(items) print("the list is sorted?" str(result)) result isSorted (sorted (items)) print("the list is sorted?" str(result)) Example Ouptut the list is sorted? False the list is sorted? True
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
