标签:nbsp span pytho 排序 ble 冒泡 python return print
def bubblesort(nums):
for i in range(len(nums)-1):
for j in range(len(nums)-i-1):
if nums[j]>nums[j+1]:
nums[j],nums[j+1]=nums[j+1],nums[j]
return nums
nums=[3,123,34,43,0,3,6,8]
print(bubblesort(nums))
标签:nbsp span pytho 排序 ble 冒泡 python return print
原文地址:http://www.cnblogs.com/zln1021/p/6372116.html