Numpad number layout
A nicer way to do the same would be to use a dictionary:

def hello(hvd, coord):        
    d = {'h': ["789", "456", "123"],
         'v': ["741", "852", "963"],   
         'd': ["159", "753"]}
    try:
        print d[hvd][coord-1]
    except IndexError:
        print "coord is wrong"
    except KeyError:
        print "hvd is wrong"