开发者

display each record of list into a separate line in jython

how to display record of the list in different line

['0 , INDIVS08 , ODI_TEMP', '1 , C$_0EMPLOYEES , ODI_TEMP', '2 , C$_0PACS08 , ODI_TEMP']

i want to display as

'0 , INDIVS08 , ODI_TEMP' ,
'1 , C$_开发者_如何学C0EMPLOYEES , ODI_TEMP',
'2 , C$_0PACS08 , ODI_TEMP'

Thanks for all of your help


lst = ['0 , INDIVS08 , ODI_TEMP', '1 , C$_0EMPLOYEES , ODI_TEMP', '2 , C$_0PACS08 , ODI_TEMP']
print(',\n'.join(["'%s'" % s for s in lst]))

',\n'.join() joins list, so it will be printed in separate lines with ending with comma.

["'%s'" % s for s in lst] is a little compilated, but it adds ' for every item in lst.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜