Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
2-liner list comprehension solution in Clear category for Second Index by swagg010164
def second_index(text: str, symbol: str) -> [int, None]:
ans = [ind for ind in range(len(text)) if text[ind] == symbol]
return None if len(ans) < 2 else ans[1]
Dec. 8, 2019
Comments: