冒泡排序----比较相邻的元素。如果第一个比第二个大,就交换它们两个
例如:L = [3,6,8,34,21,67,44,9,23,11]
def bubble_sort(value):
for i in range(1,len(value)):
for j in range(0,len(value)-i):
if value[j] > value[j+1]:
value[j],value[j+1] = value[j+1],value[j]
return value
l = [2,6,3,4,9]
a = bubble_sort(l)
print(a)