This is similar to values() except that instead of returning dictionaries, it returns tuples when iterated over. Each tuple contains the value from the respective field passed into the values_list() call — so the first item is the first field, etc.
If you only pass in a single field, you can also pass in the flat parameter. If True, this will mean the returned results are single values, rather than one-tuples. An example should make the difference clearer:
生成器表达式呢?在
或者:
^{pr2}$或者,正如出于某种原因被删除的答案所建议的那样,您可以这样做:
^{3}$或者:
最简单的解决方案是用}
flat=True
得到{相关问题 更多 >
编程相关推荐