摘要:
列表类型 1、作用 按位置存放多个值 2、定义 l=[1,1.2,'a'] # l=list([1,1.2,'a']) print(type(l)) 3、类型转换 但凡能够被for循环遍历的类型都可以当做参数传给list()转成列表 res=list('hello') print(res) res= 阅读全文
摘要:
1、有列表['alex',49,[1900,3,18]],分别取出列表中的名字,年龄,出生的年,月,日赋值给不同的变量 list1 = ['alex',49,[1900,3,18]] name = list1[0] age = list1[1] date = list1[2] 2、用列表的inser 阅读全文