How can I pad a list when printed in python?
For example, I have the following list:
mylist = ['foo', 'bar']
I want to print this padded to four indices, with commas. I know I can do the following to get it as a comma and space separated list:
', '.join(mylist)
But how can I pad it to four indices with 'x's, so the output is like:
foo, bar, x, x