算法题:
# 需求:两个列表合并,并排序 a = [1, 6, 3, 8, 5] b = [2, 3, 9, 4] c = a + b def mysorted(aList): """ 冒泡排序 :param c: :return: """ n=len(aList) for i in range(n): for j in range(n-i-1): if aList[j]>aList[j+1]: aList[j],aList[j+1]=aList[j+1],aList[j] return aList if __name__ == ‘__main__‘: result=mysorted(c) print(result)
原文:https://www.cnblogs.com/weihu/p/11753133.html