如何将元组列表转换为以索引为键的字典

How to convert list of tuples to dictionary with index as key

我正在尝试将元组列表转换为以列表索引作为键的字典。

m = [(1, 'Sports', 222), 
     (2, 'Tools', 11),
     (3, 'Clothing', 23)]

到目前为止,我已经尝试使用:

dict((i:{a,b,c}) for a,b,c in enumerate(m))

但这不起作用。

我的预期输出是:

{0: [1, 'Sports', 222],
 1: [2, 'Tools', 11],
 2: [3, 'Clothing', 23]}

使用以下词典理解:

>>> {i:list(t) for i, t in enumerate(m)}
{0: [1, 'Sports', 222], 1: [2, 'Tools', 11], 2: [3, 'Clothing', 23]}

它会起作用

tuple_list = [(1, 'Sports', 222), (2, 'Tools', 11), (3, 'Clothing', 23)]

output_dict = {}
for index, data in enumerate(tuple_list):
    output_dict[index] = list(data)

print(output_dict)