This problem is easier/more efficient to solve using a loop, but if you really, really want to write a recursive solution, let's see how to do it. First example, how to count the number of lower case letters in a string (this is the correct implementation of your string()
function):
import string
def countString(strg):
if not strg: # if it's the empty string
return 0 # then it has 0 letters
elif strg[0] in string.ascii_lowercase: # if the first char is a letter
return 1 + countString(strg[1:]) # add 1 and continue with recursion
else: # if the first char is not a letter
raise Exception, 'Incorrect Letters' # then throw an exception
countString('abcd')
=> 4
countString('ab$cd')
=> Exception: Incorrect Letters
The above will return the number of lower case letters in the input string, or throw an exception if a non-letter character was found. Notice that you can't just print a message if a non-letter character appears, it's necessary to stop the recursion, too - that's why I'm raising an exception.
Second example, how to count the number of occurrences of a character in a string (this answers the question in the title), it's similar to the previous example, but it only counts the character passed as parameter:
def countChar(strg, ch):
if not strg: # if it's the empty string
return 0 # then ch's count is 0
elif strg[0] == ch: # if the first char is ch
return 1 + countChar(strg[1:], ch) # add 1 and continue with recursion
else: # if the first char is not ch
return countChar(strg[1:], ch) # simply continue with recursion
countChar('abcdeabca', 'a')
=> 3
countChar('abcdeabca', 'x')
=> 0