#!/usr/bin/env python
#coding:utf-8
import types,sys
# 简单的排序
l=[1,9,2,3,-1,724,219,888]
for i in range(len(l)):
for j in range(i,len(l)):
if l[j] > l[i]:
l[i],l[j]=l[j],l[i]
print l
#!/usr/bin/env python
#coding:utf-8
import types,sys
# 简单的排序
l=[1,9,2,3,-1,724,219,888]
for i in range(len(l)):
for j in range(i,len(l)):
if l[j] > l[i]:
l[i],l[j]=l[j],l[i]
print l
相关课程