| about | help | code help+videos | done | prefs |
Write a function named is_sorted that accepts a list of real numbers as a parameter and returns True if the list is in sorted (nondecreasing) order and False otherwise. For example, if lists named list1 and list2 store [16.1, 12.3, 22.2, 14.4] and [1.5, 4.3, 7.0, 19.5, 25.1, 46.2] respectively, the calls is_sorted(list1) and is_sorted(list2) should return False and True respectively. Assume the list has at least one element. A one-element list is considered to be sorted. is_sorted([16.1, 12.3, 22.2, 14.4]) → False is_sorted([1.5, 4.3, 7.0, 19.5, 25.1, 46.2]) → True is_sorted([42.0]) → True ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 290 Post-solution available
Copyright Nick Parlante 2017 - privacy