【发布时间】:2020-08-10 10:25:24
【问题描述】:
给定一本字典:
entries = {'blue': ' the color of the sky', 'coffee': ' fuel for programmers'}
如何将键附加到列表中?
我已经走到这一步了:
results = []
for entry in entries:
results.append(entry[?])
【问题讨论】:
-
删除
[?]。应该足够了。但更快的只是做list(entries)
标签: python python-3.x