Python代码篇-单例模式(五种实现单利方式)

(一)、如何反序的迭代一个序列? # 若是是一个list,最来的解决方案是 tempList = [1,2,3,4] tempList.reverse() for x in tempList: print x # 若是不是一个list,最通用的解决方案 print '\n- - - - - - - - - - - -' tempTuple = (1,2,3,4) for i in
相关文章
相关标签/搜索