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

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

post - imageshack API cURL -