input: Write a function to implement a selection sort algorithm on a given list and return the sorted list. The function should take a list as input and return the sorted list. Ensure that the function is tested with an example list and the sorted result is printed.
  
  def sort_list(mylist):
   for i in range(len(mylist)):
   
   min_index = i
   temp = mylist[i]
   
   for j in range(i + 1, len(mylist)):
   
    if mylist[min_index] > mylist[j]:
     min_index = j
   
   mylist[i] = mylist[min_index]
   mylist[min_index] = temp
   
   return mylist
   
  mylist = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]
   
  assert sort_list(mylist) == [1, 1, 2, 3, 3, 4, 5, 5, 5, 6, 9]
  assert sort_list([]) == []
  assert sort_list([1]) == [1]
  assert sort_list([5, 3, 8, 4, 6]) == [3, 4, 5, 6, 8]
output: def sort_list(mylist):
   for i in range(len(mylist)):
    min_index = i
    for j in range(i + 1, len(mylist)):
     if mylist[min_index] > mylist[j]:
      min_index = j
    mylist[i], mylist[min_index] = mylist[min_index], mylist[i]
   return mylist