python
  • 安装
  • 第一个python程序
  • 基本数据类型
  • 复杂数据类型
    • Tuple
    • List
    • Slice
    • Set
    • Dictionary
  • 函数
    • 可变参数
    • 默认值参数
  • 条件判断
  • 循环
  • 模块与包
  • 类
  • SSH远程执行命令
Powered by GitBook
On this page

Was this helpful?

  1. 复杂数据类型

List

(to be continued)

List中可以存放Tuple,如果每个Tuple的元素一样多,则我们可以使用以下的方法来遍历这个List

mylist = []
mylist.append(("peng", 20))
mylist.append(("lin", 21))

for name, age in mylist:
    print name, age
PreviousTupleNextSlice

Last updated 5 years ago

Was this helpful?