python - 拆分列表列表

标签 python

如何按行拆分列表列表?

list = [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']]

进入:

a b c  
d e f  
g h i

最佳答案

In [11]: lst = [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']]

In [12]: print('\n'.join(' '.join(l) for l in lst))
a b c
d e f
g h i

关于python - 拆分列表列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10335537/

相关文章:

python - for 循环中递增

Python计算字典中的总值(value)及其百分比

python - 用新的布局替换 QScrollArea 的布局

python - Python 中的函数链接,如果某个段返回 False,则忽略链的其余部分

python - 使用正则表达式匹配不同字符组顺序同时限制给定字符可以出现多少次的优雅方法?

python - 如何使用 django 在多模型中进行搜索

python - Docker 开发环境中的丰富编辑器

python - chcp 65001 代码页导致程序终止而没有任何错误

python - numpy.random.randint() 是否总是返回连续且对齐的 ndarray?

python - 从 Tornado 开始