公司:#广联达 #小红书
岗位:#自动化测试工程师
关键字: #Python脚本#冒泡排序 #coding=utf-8 def bubble_sort(array): for i in range(1, len(array)): for j in range(0, len(array)-i): if array[j] > array[j+1]: array[j], array[j+1] = array[j+1], array[j] return array if name == 'main': array = [10, 17, 50, 7, 30, 24, 27, 45, 15, 5, 36, 21] print(bubble_sort(array))