#冒泡
list=[58,20,40,89,5,100]
length=len(list)
def bubble(list):
n=len(list)
for i in range(n):
for j in range(n-1-i):
if list[j] > list[j+1]:
temp=list[j+1]
list[j+1]=list[j]
list[j]=temp
return list
print(length)
print("待排序的数据为",list)
print("从小到大排序的数据为",bubble(list))