Formatting a list of text into columns

前端 未结 8 1028
我在风中等你
我在风中等你 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条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-07 09:21

    This works

    it = iter(skills_defs)
    for i in it:
        print('{:<60}{}'.format(i, next(it, "")))
    

    See: String format examples

提交回复
热议问题