标签:sof rem 字母 统计 ever mic lis 数字 pop
arr=["abc","def","ghi"]
arr=["abc","def","ghi"] arr.append("jkl") print(arr);
结果为:[‘abc‘, ‘def‘, ‘ghi‘, ‘jkl‘]
arr=["abc","def","ghi"] arr.clear() print(arr);
结果为: []
arr=["abc","def","ghi"] arr2=arr.copy() print(arr2);
结果为:[‘abc‘, ‘def‘, ‘ghi‘]
arr=["abc","def","abc"] count=arr.count("abc") print(count);
结果为:2
arr=["abc","def","abc"] list2=["123","456","789"] arr.extend(list2) print(arr);
结果为:[‘abc‘, ‘def‘, ‘abc‘, ‘123‘, ‘456‘, ‘789‘]
arr=["abc","def","abc"] index=arr.index("abc") print(index);
结果为:0
arr=["abc","def","abc"] arr.insert(0,"你好") print(arr);
结果为:[‘你好‘, ‘abc‘, ‘def‘, ‘abc‘]
arr=["abc","def","abc"] arr.pop(); print(arr);
结果为:[‘abc‘, ‘def‘]
arr=["abc","def","abc"] arr.remove("abc"); print(arr);
结果为:[‘def‘, ‘abc‘]
arr=["1","2","3"] arr.reverse(); print(arr);
结果为:[‘3‘, ‘2‘, ‘1‘]
arr=["3","1","2","4","9","7","8","5","0"] arr.sort(); print(arr);
结果为:[‘0‘, ‘1‘, ‘2‘, ‘3‘, ‘4‘, ‘5‘, ‘7‘, ‘8‘, ‘9‘]
arr=["a","b","c","d","e","f","g"] del arr[0:3] print(arr);
结果为:[‘d‘, ‘e‘, ‘f‘, ‘g‘]
--------------------------------------结束------------------------------------------------------------
继续学习去了,不吹了
标签:sof rem 字母 统计 ever mic lis 数字 pop
原文地址:http://www.cnblogs.com/dingjm01/p/7853738.html