摘要: 1、有列表['alex',49,[1900,3,18]],分别取出列表中的名字,年龄,出生的年,月,日赋值给不同的变量 l = ['alex', 49, [1900, 3, 18]]name = l[0]age = l[1]brt = l[2]print(name)print(age)print(b 阅读全文
posted @ 2020-03-11 18:54 凌醉枫 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 列表类型 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 阅读全文
posted @ 2020-03-11 16:54 凌醉枫 阅读(346) 评论(0) 推荐(0) 编辑