def get_nth_digit(N, n):
    """
    return the nth digit from an N digit number 
    >>> get_nth_digit(12345, 3)
    4
    >>> get_nth_digit(12345, 7)
    Traceback (most recent call last):
    ...
    IndexError: string index out of range
    """

    return int(str(N)[n])