我怎么能拒绝这样的:
students = [("Abe", 200), ("Lindsay", 180), ("Rachel" , 215)]
这个:
Abe 200
Lindsay 180
Rachel 215
编辑:这应该可以适用于任何大小的列表
This should be able to work for any size list.
使用字符串格式化:
>>> students = [("Abe", 200), ("Lindsay", 180), ("Rachel" , 215)]
>>> for a, b in students:
... print '{:<7s} {}'.format(a, b)
...
Abe 200
Lindsay 180
Rachel 215