I need to write a Python recursive function to count how many times a character in string : It should look like this:
>>> numberofcharacters('a,'america')
2
>>> numberofcharacters('e,'engineering')
3

This is what I have so far:
def count2(char,text):
    if len(text)==0:
        return 0
    else:
        if char==count2(char,text[:-1]):
            return (1+count2(char,text[:-1]))
        else:
            return False

It will just go to false, but I am trying to count how many times "char" equals each character of "text."