def get_number(symbol, is_last=False):
    """
    Convert symbol to int object.

    Allows to get "X" only if it is the last character,
    and returns 10 for it. Otherwise, raises ValueError.
    """
    if symbol == "X":
        if is_last:
            return 10
        else:
            raise ValueError("X is allowed only in the end")
    else:
        return int(symbol)