import math

def root1():
    x = input("Enter an integer: ")
    print "The square root of ", x, "is", math.sqrt(x), "."

def root2():
    x = input("Enter an integer: ")
    print "The square root of %d is %.3f." % (x, math.sqrt(x))

def root3():
    x = input("Enter an integer: ")
    print "The number:  %d" % x
    print "The square root:  %.3f" % math.sqrt(x)


def table1():
    print "x sqrt(x)"
    for x in range(1, 11):
        print x, math.sqrt(x)

def table2():
    print "123456789012345 (so you can count spaces)"
    print "%3s%10s" % ("x", "sqrt(x)")
    for x in range(1, 11):
        print "%3d%10.2f" % (x, math.sqrt(x))

def showWidth():
    print "123456789012345 (so you can count spaces)"
    for n in range(1, 11):
        print "%8s" % ("x"*n)
    
root1()
print
root2()
print
root3()
print
table1()
print
table2()
print
showWidth()
