def convert_units(P, In='cm', Out='m'):
    """
    Quickly convert distance units between meters, centimeters and millimeters
    """
    c = {'m':{'mm':1000.,'cm':100.,'m':1.},
            'cm':{'mm':10.,'cm':1.,'m':0.01},
            'mm':{'mm':1.,'cm':0.1,'m':0.001}}
    return c[In][Out]*P