k=
For I in the range (len (k)-1):
For j(len(k)- 1-I) in the range:
If k [j] >; k[j+ 1]:
k[j],k[j+ 1]=k[j+ 1],k[j]
Print (k)
This is a screenshot:
If you want to sort by selection, you can change it to:
k=
For I in the range (len (k)-1):
For j(I+ 1, len(k)) in the range:
If k [I] >; k[j]:
k[i],k[j]=k[j],k[i]
Print (k)
This is a screenshot: