Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- count = 0
- def countSubStringMatchRecursive(target, key):
- """
- Counts recursively the number of times key appears in target
- """
- global count
- count = 0
- if len(target) > len(key):
- countSubStringMatchRecursive(target[1:], key)
- if target[:len(key)].find(key) > -1:
- count += 1
- print count
Advertisement
Add Comment
Please, Sign In to add comment