Python/Format - List and width

前端 未结 1 1145
梦如初夏
梦如初夏 2020-12-12 04:03

This is how my format is working so far for my list :

print(\'{:>15} {:>15} {:>15}{:>15}\'.format(*i_liste_l))

I\'m very new to

相关标签:
1条回答
  • 2020-12-12 04:43

    You can specify width as follow (passing keyword argument width):

    >>> '{:>{width}} {:>{width}}'.format(1, 2, width=5)
    '    1     2'
    
    0 讨论(0)
提交回复
热议问题