如何在python中使用变量之间的制表符来创建包含3列的单行?
这基本上是我要打印的变量:如何在python中使用变量之间的制表符来创建包含3列的单行?,python,tabs,Python,Tabs,这基本上是我要打印的变量: 打印n、bu、qui 现在我有这样一个: 打印n“\t”,int(bu.total_seconds()*1000)”\t,int(qui.total_seconds()*1000)”\t“使用str.format: print "{}\t{}\t{}".format(n, int(bu.total_seconds() * 1000),int(qui.total_seconds() * 1000)) 您可以通过多种不同的方式对齐格式使用使用str.format: pr
打印n、bu、qui
现在我有这样一个:
打印n“\t”,int(bu.total_seconds()*1000)”\t,int(qui.total_seconds()*1000)”\t“
使用str.format
:
print "{}\t{}\t{}".format(n, int(bu.total_seconds() * 1000),int(qui.total_seconds() * 1000))
您可以通过多种不同的方式对齐格式使用使用
str.format
:
print "{}\t{}\t{}".format(n, int(bu.total_seconds() * 1000),int(qui.total_seconds() * 1000))
您可以使用多种不同的方式对齐格式使用不用担心,您可以使用str.format右对齐、左对齐和其他多种方式。不用担心,您可以使用str.format右对齐、左对齐和其他多种方式