def leading_zero(in_string):
    """Add a leading zero to a string with only one character.

    :param in_string:           string of min length 1 and max length 2

    :return:                    string with length of 2 and with leading zero where applies

    """
    len_string = len(in_string)

    if (len_string > 2) or (len_string < 1):
        raise ValueError("Value must have only one or two characters.  Input '{}' has {}".format(in_string, len_string))

    elif len_string == 1:
        return "0{}".format(in_string)

    else:
        return in_string