Tell us what’s happening:
it’s wroking and i think i made quite the same algorithme as the others posts , i really dont understand where is the problem here
Your code so far
def selection_sort(l):
lenth=len(l)
for i in range(lenth):
for j in range(lenth):
if l[i] <l[j]:
l[j],l[i] =l[i],l[j]
return l
tab=[12,3,45,5,8,78,2,8,4,7,-3,-72,-4]
print(selection_sort(tab))
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36 OPR/133.0.0.0
Challenge Information:
Implement the Selection Sort Algorithm - Implement the Selection Sort Algorithm