【发布时间】:2020-10-03 07:18:26
【问题描述】:
正在尝试转换:
word_vomit = [(('best', 'cat', 'breed'), 3), (('dogs', 'wearing', 'hats'), 3), (('did', 'you', 'eat'), 2), (('cats', 'are', 'evil'), 1), (('i', 'hate', 'lists'), 1)]
进入这个:
goal = {'best cat breed': '3','dogs wearing hats': '3','did you eat': '2','cats are evil': '1','i hate lists': '1'}
提前感谢所有 cmets
【问题讨论】:
标签: python python-3.x dictionary tuples