标签:containe http 列表 class key cells comm lin comment
本节内容
列表是我们最以后最常用的数据类型之一,通过列表可以对数据实现最方便的存储、修改等操作
定义列表
|
1
|
names = [‘Alex‘,"Tenglan",‘Eric‘] |
通过下标访问列表中的元素,下标从0开始计数
|
1
2
3
4
5
6
7
8
|
>>> names[0]‘Alex‘>>> names[2]‘Eric‘>>> names[-1]‘Eric‘>>> names[-2] #还可以倒着取‘Tenglan‘ |
标签:containe http 列表 class key cells comm lin comment
原文地址:http://www.cnblogs.com/dada1991/p/7257217.html