骄傲的赛亚人

python一行命令将两个列表合并成字典

all_id=["id","name","age"]
all_value=["12","kuang","22"]

dic = dict(map(lambda x, y: [x, y], all_id, all_value))

print(dic)

输出:{'id': '12', 'name': 'kuang', 'age': '22'}

posted on 2021-01-24 12:59  骄傲的赛亚人  阅读(1)  评论(0编辑  收藏  举报

导航