gpt4 book ai didi

python - 如何将列表添加到字典?

转载 作者:太空宇宙 更新时间:2023-11-04 07:14:31 25 4
gpt4 key购买 nike

<分区>

如何将现有列表添加到字典中?

具体来说,如果我有:

lst = [["Hi"],["Monty"],["Python"],["snake"],["Anaconda"]]

我想得到:

d = {0: "Hi", 1: "Monty", 2: "Python", 3: "snake", 4: "Anaconda"}

我该怎么做?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com