In [2]:
import random

In [3]:
ten = random.sample(range(10000), 10)
hundred = random.sample(range(10000), 100)
thousand = random.sample(range(10000), 1000)

In [4]:
def sorted_list(l): 
    for item in l:
        if item < l[l.index(item)-1]:
            try:
                l.insert((l.index(item)-2),item), l.pop(l.index(item))
            except ValueError:
                pass
        if item >= l[(l.index(item))-1]:
            continue
    return l

In [ ]: