I wrote a sorting algorithm in python, but I think it looks pretty bad. How can I make it better and more efficient?
#lis is the list you want to sort for smallest to biggest
def sortMin(lis):
output = []
listen = lis
for i in range(len(lis)):
curNum = lis[0]
curArr = 0
for j in range(len(lis)):
if listen[j] < curNum:
curNum = listen[j]
curArr = j
output.append(curNum)
listen.pop(curArr)
return output
Edit: I know of the list.sort() function, but I want to make my own.
lst.sort()sort