#! /usr/bin/python
"""
Prints out the multiplication tables
>>> table(1)
'1   2   3   4   5   6   7   8   9  10  11  12'
>>> table(2)
'2   4   6   8  10  12  14  16  18  20  22  24'
>>> table(3)
'3   6   9  12  15  18  21  24  27  30  33  36'
"""
import sys


def table(n):
    output = ""
    row = range(n*1, n*13, n)
    for item in row:
        item = str(item)
        output += item.rjust(4)
    return output.lstrip(' ')

if __name__ == "__main__":
    if len(sys.argv) > 1:
        if sys.argv[1] == 'test':
            import doctest
            doctest.testmod()
        else:
            print "nope"
    else:
        for i in range(1, 13):
            print table(i)
