logo CodeStepByStep logo

min_to_front

Language/Type: Python lists collections

Write a function min_to_front that takes a list of integers as a parameter and that moves the minimum value in the list to the front, otherwise preserving the order of the elements. For example, if a variable called list stores the following values: [3, 8, 92, 4, 2, 17, 9] and you make the call of min_to_front(list) it should store the following values after the call: [2, 3, 8, 92, 4, 17, 9] You may assume that the list stores at least one value.

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.