Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def count_c(s, c):
- if len(s)==0:
- return
- if s[0]==c:
- return 1 + count_c(s[1:], c)
- else:
- return 0 + count_c(s[1:], c)
- print('the number of letters is: ' + count_c('ciao amico come cacchio stai?','c'))
- print('the number of letters is: ' + count_c('ccc','c'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement