当前位置:天才代写 > tutorial > Python教程 > python 冒泡排序

python 冒泡排序

2018-05-17 08:00 星期四 所属: Python教程 浏览:368

[Python]代码 “` python
def maopao(list):
for i in range(0, len(list)):
for j in range(len(list) – 1, i – 1, -1):
if list[j] < list[j-1]:
temp = list[j] list[j] = list[j-1] list[j-1] = temp
#printResult(list)

def printResult(list):
for i in range(0, len(list)):
print list[i],
print

List = [9,1,7,3,8,2,6,4,0] maopao(List)
print List
“`

标签:python

 

    关键字:

天才代写-代写联系方式