I have the pretty print module, which I prepared because I was not happy the pprint module produced zillion lines for list of numbers which had one list of list. Here is exa
You can write:
'\n'.join( # join the lines with '\n' ' '.join( # join one line with ' ' "%2d" % (i + j) # format each item for i in range(10)) for j in range(10))