list()函数将其它序列转换为 列表 (就是js的数组)。 该函数不会改变   其它序列

    效果图一:

python的list()函数

    代码一:

# 定义一个元组序列
tuple_one = (123,'456','abc')
print(tuple_one,type(tuple_one))
# 转换并赋值给变量 a
a = list(tuple_one)
# 输出 a , a的类型
print(a,type(a))

    效果图二:

python的list()函数

    代码二:

list_one = [1,2,3,4,5,6,7,8,9,10]

r = filter(lambda i : i > 5 , list_one)
print(r,type(r))
t = list(r)
print(t,type(t))

 

相关文章:

  • 2022-01-06
  • 2022-01-07
  • 2021-11-14
  • 2022-01-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-13
  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-27
相关资源
相似解决方案