import random
def bubble_sort(li):
for i in range(len(li) - 1):
for j in range(len(li) - i - 1):
if li[j] > li[j + 1]:
li[j], li[j + 1] = li[j + 1], li[j]
li = [random.randint(0, 20) for i in range(15)]
print(li)
bubble_sort(li)
print(li)
标签:sort,06,random,range,冒泡排序,li,算法
From: https://www.cnblogs.com/jenny-jenny/p/17601455.html