Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def fib(n):
- if(n == 0):
- return 0
- if(n == 1):
- return 1
- else:
- return fib(n-1) + fib(n-2)
- #print fib(9)
- def vowelCount(str):
- vowels = ["a", "e", "i", "o", "u", "A", "E", "I", "O", "U"]
- for vowel in vowels:
- if(str[0] == vowel):
- return 1 + int(vowelCount(str[1:]))
- else:
- return int(vowelCount(str[1:]))
- vowelCount("Haniel")
- def replaceAll(str, char):
- return replaceAll(str, char)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement