import random

unordered = range(10)
random.shuffle(unordered)

list = []
list = [0,1,3,4,5,2,6,7,8,9]

def selection_sort(list):
    l=list[:]                 
    sorted=[]                  
    while len(l):              
        lowest=l[0]            
        for x in l:           
            if x<lowest:       
                lowest=x
        sorted.append(lowest)  
        l.remove(lowest)       
    return sorted

im trying to manually sort a list of integers from 0 to 9 using selection sort. i cant figure it out at all...

The only 'problem' that I see is that you are using the reserved words, 'list' and 'sorted', as variable names, and that you are sorting 'list' and not 'unordered'. Otherwise it looks fine so you will have to be more specific about the problems.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.