标签:app 小练习 har highlight bsp 重复 tor 排序 练习
倒排:
a="shdjcdda" p="" count=0 for j in range(0,len(a)) : for i in range(0,len(a)) : if j<=i : t=a[i-count] count=count+1 p+=t print(p)
排序:
__author__ = ‘Administrator‘ a=[5,8,16,1,74,2,3,85,24] t=[] for i in range(0,len(a)) : for j in range(0,len(a)) : if a[i]<a[j]: t=a[i] a[i]=a[j] a[j]=t print(a)
算重复:
__author__ = ‘Administrator‘ a=[5,3,16,5,74,5,3,85,24] t=[] for i in a : count=0 for j in a : if i==j: count=count+1 if count>1: if i not in t: t.append(i) print(i,count)
标签:app 小练习 har highlight bsp 重复 tor 排序 练习
原文地址:http://www.cnblogs.com/hanzhao1987/p/6112928.html