相关疑难解决方法(0)

将List转换为元组python列表

我是python的新手,需要将列表转换为字典.我知道我们可以将元组列表转换为字典.

这是输入列表:

L = [1,term1, 3, term2, x, term3,... z, termN]
Run Code Online (Sandbox Code Playgroud)

我想将此列表转换为元组列表(OR到字典),如下所示:

[(1, term1), (3, term2), (x, term3), ...(z, termN)]
Run Code Online (Sandbox Code Playgroud)

我们怎样才能轻松实现python?

python tuples list

44
推荐指数
5
解决办法
2万
查看次数

标签 统计

list ×1

python ×1

tuples ×1