Selection Sort in Python - Computer Notes

PHOTO EMBED

Sat Oct 09 2021 07:45:04 GMT+0000 (Coordinated Universal Time)

Saved by @Adam101 #sort #python

def sort(nums):
    for i in range(5):
         minpos = i
         for j in range(i,6):
            if nums[j] < nums[minpos]:
               minpos = j
               temp = nums[i]
               nums[i] = nums[minpos]
               nums[minpos] = temp
nums = [5,3,8,6,7,2]
sort(nums)
print(nums)
content_copyCOPY

selection sort python

https://ecomputernotes.com/python/selection-sort-in-python