a = [9, 1, 5, 3, 7, 2, 8, 6, 4]
for i in range(len(a)):
    min_index = i
    for j in range(i+1, len(a)):
        if a[j] < a[min_index]:
            min_index = j

    a[i], a[min_index] = a[min_index], a[i]
    print(i+1, "회차", a)

print(a)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: