Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Second Index by FromVault13
def second_index(text: str, symbol: str) -> [int, None]:
"""
returns the second index of a symbol in a given text
"""
if text.count(symbol) < 2: return None
return text[text.index(symbol) + 1:].index(symbol) + text.index(symbol) + 1
June 13, 2018
Comments: