shopping_list = { 'potato' : 8, # etc }
使用 Dict
Dict
因为 json.dumps 只能收集字典,因此必须编写代码才能将其转换为 Dict() 反对。
json.dumps
Dict()