代码:
from random import sample
a = [sample([i for i in range(10)], 1)[0] for i in range(10)]
print(a)
def sort(listValue, resultValue=list()):
if listValue == []:
return resultValue
else:
temp = listValue[0]
for i in range(len(listValue)):
if temp > listValue[i]:
temp = listValue[i]
resultValue.append(temp)
listValue.remove(temp)
return sort(listValue, resultValue)
if __name__ == '__main__':
result = sort(a, [])
print(result)