how can I use recursion to find the amount of 'a' that is in a string:
example: get_a('halloa') -> 2
here is what I have:
def get_a(string):
'''
return how many times a exist in the string using recursion
'''
if string == '':
return 0
if string[0] == 'a':
return 1
return get_a(string[1:])
.countmethod.