Inactive Tutor answered 08/01/23
Richard P.
asked 07/31/23(Sorted?) Write the following function that returns True if the list is already sorted in increasing order:
def isSorted(lst):
Write a test program that prompts the user to enter a list of numbers separated by a space in one line and displays whether the list is sorted or not. Don’t use the Python list sort method in this program. Here is a sample run:
Sample Run 1
Enter list: 1 1 3 4 4 5 7 9 10 30 11
The list is not sorted
Sample Run 2
Enter list: 1 1 3 4 4 5 7 9 10 30
The list is already sorted
1 Expert Answer
Still looking for help? Get the right answer, fast.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.