posts - 27,  comments - 3,  trackbacks - 0
          Example 3.15 Defining a tuple
          1、tuple沒有任何方法
          2、tuple和list可以相互轉化
          4、
          Common tuple literals and operations

          Operation

          Interpretation

          ( )

          An empty tuple

          t1 = (0,)

          A one-item tuple (not an expression)

          t2 = (0, 'Ni', 1.2, 3)

          A four-item tuple

          t2 = 0, 'Ni', 1.2, 3

          Another four-item tuple (same as prior line)

          t3 = ('abc', ('def', 'ghi'))

          Nested tuples

          t1[i]t3[i][j]t1[i:j]len(t1)

          Index, slice, length

          t1 + t2t2 * 3

          Concatenate, repeat

          for x in t23 in t2

          Iteration, members


          tuple這些操作和list非常之象。。


          Jafe 2007-08-28 21:11 發表評論
          posted on 2007-08-28 21:11 Jeff Lee 閱讀(180) 評論(0)  編輯  收藏 所屬分類: python

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           

          <2007年8月>
          2930311234
          567891011
          12131415161718
          19202122232425
          2627282930311
          2345678

          常用鏈接

          留言簿(1)

          隨筆分類

          隨筆檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 婺源县| 疏附县| 沁阳市| 武威市| 象山县| 资兴市| 托克托县| 安顺市| 闻喜县| 临湘市| 五峰| 襄垣县| 金寨县| 祁门县| 济阳县| 旺苍县| 聂拉木县| 新龙县| 凤凰县| 富川| 北安市| 鸡西市| 威远县| 莱西市| 和政县| 鹤峰县| 抚顺县| 甘洛县| 专栏| 上栗县| 六枝特区| 垣曲县| 武宁县| 自治县| 兰西县| 都昌县| 陆河县| 孝感市| 屯昌县| 德庆县| 蓬莱市|