python基礎知識(六)-python數據結構

一  python列表 a=[1,2,3,4]  print(a.pop())#輸出4 二 遍歷技巧 在字典中遍歷時,關鍵字和對應的值可以使用 items() 方法同時解讀出來: book={1:'西遊記','2':'水滸傳'} for x,y in book.items():     print(x,y)#輸出1 西遊記 2 水滸傳 同時遍歷兩個或更多的序列,可以使用 zip() 組合: que
相關文章
相關標籤/搜索