Formatting a list of text into columns

前端 未结 8 1036
我在风中等你
我在风中等你 2021-02-07 08:34

I\'m trying to output a list of string values into a 2 column format. The standard way of making a list of strings into \"normal text\" is by using the string.join

8条回答
  •  梦毁少年i
    2021-02-07 09:40

    data = [ ("1","2"),("3","4") ]
    print "\n".join(map("\t".join,data))
    

    Not as flexible as the ActiveState solution, but shorter :-)

提交回复
热议问题