#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];
时间: 2024-11-03 21:06:27