def maopao(list):
len_list = len(list)
for i in range(len_list - 1, 0, -1):
count = 0
for j in range(i):
if list[j] > list[j + 1]:
list[j + 1], list[j] = list[j], list[j + 1]
count += 1
if 0 == count:
break
return list
def maopao2(list):
len_list = len(list)
for i in range(len_list):
for j in range(0, len_list - i - 1):
if list[j] > list[j + 1]:
list[j + 1], list[j] = list[j], list[j + 1]
return list