logo CodeStepByStep logo

sorted

Language/Type: Python lists traversals

Write a function named sorted that accepts a list of floats as a parameter and returns True if the list is in sorted order and False if not. For example, if a list named list stores [1.5, 4.3, 7.0, 19.5, 25.1, 46.2] respectively, the call of sorted(list2) should return True. You may assume the list has at least one element. A one-element list is considered to be sorted. Do not modify the list passed in.

Function: Write a Python function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.