我怎样才能改变这个:
students = [("Abe", 200), ("Lindsay", 180), ("Rachel" , 215)]
进入此:
Abe 200
Lindsay 180
Rachel 215
编辑:这应该适用于任何大小的列表。
最佳答案
>>> students = [("Abe", 200), ("Lindsay", 180), ("Rachel" , 215)]
>>> for a, b in students:
... print '{:<7s} {}'.format(a, b)
...
Abe 200
Lindsay 180
Rachel 215
关于python - 将 Python 2D 矩阵/列表转换为表格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22670097/