python:写冒泡排序
def bubblesort(num): for i in range(len(num)-1): for j in range(len(num)-i-1): if nums[j]>nums[j+1]: nums[j],num[j+1] = nums[j+1],nums[j] return nums nums = [2,3,5,1,6,8,9] print(bubblesort(nums))