Objective
Create a Python program that sorts a list with the selection sort algorithm and shows the list after each step.
Instructions
- Read a line with at least two integers separated by spaces.
- For each position
ifrom 0 tolen(list) - 2: find the position of the smallest element betweeniand the end (if there is a tie, the first one) and swap it with the one at positioni. - After each step show
Step K: n1 n2 ..., with K starting at 1.
64 25 12 22 11
Step 1: 11 25 12 22 64
Step 2: 11 12 25 22 64
Step 3: 11 12 22 25 64
Step 4: 11 12 22 25 64
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise