我有一个像下面这样的长字符串,我试图格式化 aswel 使其与 PEP 标准保持一致
'http://abc/api/run=1&'+ \
'actionData=[{"query":"air-{0}-{1}-{2}--1-0-0-E-111--"},{"query":"hotels-{1}-{3}-{4}-1-1_0-"},{"query":"air-{1}-{0}-{5}--1-0-0-E-111--"}]'+ \
'&tripOrigin={0}&tripDestination={1}'.format(origin.get('vcid'), destination.get('vcid'), onward_f_date, check_in_date, check_out_date, return_f_date)
但是遇到这样的输出
'http://abc/api/run=1&actionData=[{"query":"air-{0}-{1}-{2}--1-0-0-E-111--"},{"query":"hotels-{1}-{3}-{4}-1-1_0-"},{"query":"air-{1}-{0}-{5}--1-0-0-E-111--"}]&tripOrigin=2311443&tripDestination=123445667'
期望格式化发生在所有 {0}、{1}、{2}、{3}、{4} 和 {5}