A simple function in python to return a list of all occurrences of a given character in a string.
def findOccurences(s, ch):
return [i for i, letter in enumerate(s) if letter == ch]
A simple function in python to return a list of all occurrences of a given character in a string.
def findOccurences(s, ch):
return [i for i, letter in enumerate(s) if letter == ch]