2.利用循环来实现
3.利用 enumerate 函数生成index来实现
my_dict = {} for index, item in enumerate(spanss): if index % 2 == 0: my_dict[item] = spanss[index + 1]
330阅读 0评论2022-07-05 centrify
分类:Python/Ruby
my_dict = {} for index, item in enumerate(spanss): if index % 2 == 0: my_dict[item] = spanss[index + 1]