Selection Sort-array sorting
<p>When I run it only the first smallest number gets sorted. Is the problem somewhere in the loops?</p>

<pre><code>def selectionSort(A):
    n=len(A)
    print(n)

    mini=0
    for i in range(0,n-2):
        mini=i
        for j in range(i+1,n-1):
            if A[j]&lt;A[mini]:
                mini=j
            if i!=mini:
                temp=A[i]
                A[i]=A[mini]
                A[mini]=temp

    return A
</code></pre>

<p>Yes the problem is in the swapping part of your code, it needs to placed after inner for-loop</p>

<pre><code>def selectionSort(A):
    n = len(A)
    mini=0
    for i in range(0,n-2):
        mini=i
        for j in range(i+1,n-1):
            if A[j]&lt;A[mini]:
                mini=j
        if i!=mini:
            temp=A[i]
            A[i]=A[mini]
            A[mini]=temp

    return A
</code></pre>

python