题目:利用for循环,完成a=[1,7,4,89,34,2]的冒泡排序(冒泡排序:小的排前面,大的排后面.) 第一种:可以看到每次排序的结果 a = [100,97,4,89,34,2] n = 0 for n in range(0,5): for i in range(0,len(a)-1): if a[i] > a[i+1]: a[i+1],a[i] = a[i],a[i+1] # change = a[i] # a[i] = a[i+1] # a[i+1] = change n += 1…