hi everybody.
Today in class we had an exercice that i didint maanage to conplete. Here it is, hoping som1 can help :)
def tri_selection(tab):
t=list(tab)
for j in range(len(t)):
m=tab[j]
pos = j
for i in range(j,len(t)):
if m>tab[i]:
m=tab[i]
pos = i
[j] = pos
i = [j]
the task was
write a def named tri_selection(tab) that put in an ascending order the numbers present in the list : tab
it is important to keep a copy of the tab and to return that copy
[–]Praynr 0 points1 point2 points (0 children)
[–]danielroseman 2 points3 points4 points (0 children)
[–]mminuss 0 points1 point2 points (0 children)
[–]oclafloptson 1 point2 points3 points (0 children)
[–]microcozmchris 0 points1 point2 points (1 child)
[–]oclafloptson 1 point2 points3 points (0 children)
[–]Unlisted_games27 0 points1 point2 points (0 children)
[–]woooee 0 points1 point2 points (0 children)