def IndexOfNth ( s , value , n ) : remaining = n for i in xrange ( 0 , len ( s ) ) : if s [ i ] == value : remaining -= 1 if remaining == 0 : return i return - 1
printing nth occurence of character in string using python
Gets the index of Nth occurance of a given character in a string
def IndexOfNth(s, value, n):
    """Gets the index of Nth occurance of a given character in a string

    :param str s:
        Input string
    :param char value:
        Input char to be searched.
    :param int n:
        Nth occurrence of char to be searched.

    :return:
        Index of the Nth occurrence in the string.
    :rtype: int

    """
    remaining = n
    for i in xrange(0, len(s)):
        if s[i] == value:
            remaining -= 1
            if remaining == 0:
                return i
    return -1