string - Python: print in two columns -


i'm trying print string 2 fixed columns. example, i'd able print:

abc       xyz abcde     xyz         xyz 

what correct way format output string when printing achieve this? also, how done before version 2.6 , after version 2.6?

you can use format , mention fix spaces between columns

'{0:10}  {1}'.format(s1, s2) 

old style formatting

'%-10s' '%s' % (s1,s2) 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -