I want to find how many times an character repeated in a word for example: how many times the 'l' repeated in the "Hello". but it drops me this error:
IndexError: string index out of range
And my code:
def fin(x,lst):
if x == '':
return 0
if lst[0] == x:
return 1+ fin(x,lst[1:])
else:
return fin(x,lst[1:])
fin("X", "")?