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
相關文章
相關標籤/搜索