Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. def fib(n):
  2.     if(n == 0):
  3.         return 0
  4.     if(n == 1):
  5.         return 1
  6.     else:
  7.         return fib(n-1) + fib(n-2)
  8.  
  9. #print fib(9)
  10.  
  11. def vowelCount(str):
  12.     vowels = ["a", "e", "i", "o", "u", "A", "E", "I", "O", "U"]
  13.     for vowel in vowels:
  14.         if(str[0] == vowel):
  15.             return 1 + int(vowelCount(str[1:]))
  16.         else:
  17.             return int(vowelCount(str[1:]))
  18.  
  19. vowelCount("Haniel")
  20.  
  21. def replaceAll(str, char):
  22.  
  23.     return replaceAll(str, char)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement