I'm trying to print a string with two fixed columns. For example, I'd like to be able to print:
abc xyz
abcde xyz
a xyz
What is the correct way to format the output string when printing to achieve this? Also, how is this done before version 2.6 and after version 2.6?
You can use format and mention fix spaces between columns
'{0:10} {1}'.format(s1, s2)
Old Style formatting
'%-10s' '%s' % (s1,s2)