Python Regex在多个字符串之间添加间距
我想表示:Python Regex在多个字符串之间添加间距,python,regex,Python,Regex,我想表示: print('{:<16s}{:>16s}{:>16s}{:>16s}{:>16s}{:>16s}'.format('Id', 'Loan Amount', 'Country Name', 'Status', 'Time to Raise', 'Total Number of Lenders')) 谢谢您的时间。您可以通过执行“xxx”*5将同一个字符串连接多次,并将数字置于外部 print(('{:>16s}' * 5).format(
print('{:<16s}{:>16s}{:>16s}{:>16s}{:>16s}{:>16s}'.format('Id', 'Loan Amount', 'Country Name', 'Status', 'Time to Raise', 'Total Number of Lenders'))
谢谢您的时间。您可以通过执行
“xxx”*5
将同一个字符串连接多次,并将数字置于外部
print(('{:>16s}' * 5).format('Id','Loan Amount','Country Name','Status','Time to Raise',
'Total Number of Lenders'))
请注意,对于
Id
格式为向右拉,第一个给定的确切对应如下所示
print(('{:<16s}' + '{:>16s}' * 5).format('Id', 'Loan Amount', 'Country Name', 'Status',
'Time to Raise','Total Number of Lenders'))
print(('{:16s}'*5).格式('Id','Loan Amount','Country Name','Status',',
“融资时间”、“贷款人总数”))
print(('{:<16s}' + '{:>16s}' * 5).format('Id', 'Loan Amount', 'Country Name', 'Status',
'Time to Raise','Total Number of Lenders'))