I am dumbfounded as to why this prints None:
print([1,2].sort())
No I have not made a separate function called print or anything, this is the entire script (I am playing around learning sorting algorithms):
import subprocess
subprocess.run('clear')
array = [1, 3, 3, 0, 5, 2, 6]
def selectionsort(arr : list):
for start_idx in range(len(arr)):
min_element = arr[start_idx]
for element in arr[start_idx:]:
if element < min_element:
min_element = element
min_idx = arr[start_idx:].index(min_element) + start_idx
arr[min_idx], arr[start_idx] = arr[start_idx], arr[min_idx]
return arr
print(selectionsort(array))
print([1, 2].sort())
If my selectionsort is wrong or ineffective I don't want any help with that, I just want to figure out why this prints None for now.