def convert_units(P, In='cm', Out='m'):
    """
    Quickly convert distance units between meters, centimeters and millimeters
    """
    c = {'m': {'mm': 1000.0, 'cm': 100.0, 'm': 1.0}, 'cm': {'mm': 10.0,
        'cm': 1.0, 'm': 0.01}, 'mm': {'mm': 1.0, 'cm': 0.1, 'm': 0.001}}
    return c[In][Out] * P
