标签:
#coding=utf-8 #!/usr/bin/python list = [‘a‘, 1, ‘b‘, 2, ‘c‘, 3]; print list[0]; print list[1:3]; print list * 2; print list + list + list; # 遍历 print(‘for each method 1 : ‘); for data in list: print data; print(‘for each method 2 : ‘); for i in range(0, len(list)) : print list[i];
Python 2.7.9 - 014.列表List的定义、取值、遍历
标签:
原文地址:http://www.cnblogs.com/nick-huang/p/4617283.html