List是python的基本数据类型之一
当成基本数组的赋值以及访问
list1=[1,2,3,4] list2=["cnm","fuck you","nmsl"] print(list1)#输出[1,2,3,4] print(list1[0])#输出1 print(list1[1:5])#[2,3,4] print(list1[0:1])#[1] print(list1[0:2])#[1,2] print(list1[0:4])#[1,2,3,4] print(list2[1])#fuck you
原文:https://www.cnblogs.com/theda/p/11817109.html