#!/usr/bin/python import random def select_sort(l): n = len(l) for i in range(n-1): min_index = i # Find the minimum element in unsorted array for j in range(i+1, n): if l[j] < l[min_index]: min_index = j l[i], l[min_index] = l[min_index], l[i] def get_list(): random.seed() l = random.choices(range(10), k=10) return l def main(): l = get_list() print(l) select_sort(l) print(l) if __name__ == '__main__': main()