[ create a new paste ] login | about

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

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

print count_letters('abcdefg')


Output:
1
7


Create a new paste based on this one


Comments: