[ create a new paste ] login | about

Link: http://codepad.org/4r7j0sn5    [ raw code | output | fork ]

morgkl6 - Python, pasted on Jan 20:
1
2
3
4
5
6
7
8
9
def count_letters(s):
    if s == '':
        return 0
    return 1 + count_letters(s[1:])

def print_count_letters():
    print count_letters('abcdefg')

print_count_letters()


Output:
1
7


Create a new paste based on this one


Comments: